Skip to content

Commit

Permalink
$request->params might not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Jun 19, 2010
1 parent 1ba9d07 commit f451804
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/tag/helpers/tags_rest.php
Expand Up @@ -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);
Expand Down

0 comments on commit f451804

Please sign in to comment.