summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-19 15:00:44 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-19 15:00:44 -0700
commitf451804c6d82bfbf214f08717c66684da66ca328 (patch)
treefc880e452a811de29f62ddd973c8fa4f28fe47dd
parent1ba9d079bfaa1be48186aaa51bcb0059886d4891 (diff)
$request->params might not exist.
-rw-r--r--modules/tag/helpers/tags_rest.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/tag/helpers/tags_rest.php b/modules/tag/helpers/tags_rest.php
index 975cf140..4f40e7f4 100644
--- a/modules/tag/helpers/tags_rest.php
+++ b/modules/tag/helpers/tags_rest.php
@@ -29,9 +29,13 @@ class tags_rest_Core {
static function get($request) {
$tags = array();
- $p = $request->params;
- $num = isset($p->num) ? min((int)$p->num, 100) : 10;
- $start = isset($p->start) ? (int)$p->start : 0;
+ $num = 10;
+ $start = 0;
+ if (isset($request->params)) {
+ $p = $request->params;
+ $num = isset($p->num) ? min((int)$p->num, 100) : 10;
+ $start = isset($p->start) ? (int)$p->start : 0;
+ }
foreach (ORM::factory("tag")->find_all($num, $start) as $tag) {
$tags[] = rest::url("tag", $tag);