diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-09-13 01:04:16 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-09-13 01:04:16 -0700 |
commit | caa2002d7777e0ceb884d4c628650804620ca2b6 (patch) | |
tree | b64f05e2a7bd8db7200e3c407904e255826b4cf2 | |
parent | 711cdde5b9755140981000adc6dd7897d836ccc5 (diff) |
If there's a show= param and we can't find the given id in the current
album, just ignore the parameter.
-rw-r--r-- | modules/gallery/controllers/albums.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 183c26d0..08a60132 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -40,11 +40,13 @@ class Albums_Controller extends Items_Controller { if ($show) { $index = $album->get_position($show); - $page = ceil($index / $page_size); - if ($page == 1) { - url::redirect($album->abs_url()); - } else { - url::redirect($album->abs_url("page=$page")); + if ($index) { + $page = ceil($index / $page_size); + if ($page == 1) { + url::redirect($album->abs_url()); + } else { + url::redirect($album->abs_url("page=$page")); + } } } |