From 670312ff10b5083a349456df116b5c815ccc73a0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 18 Nov 2009 11:26:19 -0800 Subject: For album pagination, don't let the last_visible_position exceed the total. Fixes ticket #903. --- modules/gallery/libraries/Theme_View.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/libraries/Theme_View.php') 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; -- cgit v1.2.3