summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Theme_View.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-11-18 11:26:19 -0800
committerBharat Mediratta <bharat@menalto.com>2009-11-18 11:26:19 -0800
commit670312ff10b5083a349456df116b5c815ccc73a0 (patch)
treef6054036c7fde68e1f63a43a7c32ab50c7cffb40 /modules/gallery/libraries/Theme_View.php
parent7c2c77f3c15f32522381c2599a496a3807d4b454 (diff)
For album pagination, don't let the last_visible_position exceed the
total. Fixes ticket #903.
Diffstat (limited to 'modules/gallery/libraries/Theme_View.php')
-rw-r--r--modules/gallery/libraries/Theme_View.php2
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;