diff options
Diffstat (limited to 'modules/tag')
-rw-r--r-- | modules/tag/controllers/tags.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php index 930c1252..295a9d3b 100644 --- a/modules/tag/controllers/tags.php +++ b/modules/tag/controllers/tags.php @@ -27,16 +27,16 @@ class Tags_Controller extends REST_Controller { $offset = ($page-1) * $page_size; // Make sure that the page references a valid offset - if ($page < 1 || $page > ceil($children_count / $page_size)) { + if ($page < 1 || ($children_count && $page > ceil($children_count / $page_size))) { Kohana::show_404(); } $template = new Theme_View("page.html", "tag"); - $template->set_global('page_size', $page_size); - $template->set_global('page_title', t("Browse Tag::%name", array("name" => $tag->name))); - $template->set_global('tag', $tag); - $template->set_global('children', $tag->items($page_size, $offset)); - $template->set_global('children_count', $children_count); + $template->set_global("page_size", $page_size); + $template->set_global("page_title", t("Browse Tag::%name", array("name" => $tag->name))); + $template->set_global("tag", $tag); + $template->set_global("children", $tag->items($page_size, $offset)); + $template->set_global("children_count", $children_count); $template->content = new View("dynamic.html"); print $template; |