Permalink
Browse files

If there's a show= param and we can't find the given id in the current

album, just ignore the parameter.
  • Loading branch information...
1 parent 711cdde commit caa2002d7777e0ceb884d4c628650804620ca2b6 @bharat bharat committed Sep 13, 2009
Showing with 7 additions and 5 deletions.
  1. +7 −5 modules/gallery/controllers/albums.php
@@ -40,11 +40,13 @@ public function _show($album) {
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"));
+ }
}
}

0 comments on commit caa2002

Please sign in to comment.