diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-11-18 11:26:19 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-11-18 11:26:19 -0800 |
commit | 670312ff10b5083a349456df116b5c815ccc73a0 (patch) | |
tree | f6054036c7fde68e1f63a43a7c32ab50c7cffb40 | |
parent | 7c2c77f3c15f32522381c2599a496a3807d4b454 (diff) |
For album pagination, don't let the last_visible_position exceed the
total. Fixes ticket #903.
-rw-r--r-- | modules/gallery/libraries/Theme_View.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 07ba3bbf..b1167d0e 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -171,7 +171,7 @@ class Theme_View_Core extends Gallery_View { } $v->first_visible_position = ($this->page - 1) * $this->page_size + 1; - $v->last_visible_position = $this->page * $this->page_size; + $v->last_visible_position = min($this->page * $this->page_size, $v->total); } else { $v->position = $this->position; $v->total = $this->sibling_count; |