summaryrefslogtreecommitdiffstats
path: root/system/libraries/Pagination.php
diff options
context:
space:
mode:
authorEric Barnes <eric@ericlbarnes.com>2012-01-04 06:28:27 +0100
committerEric Barnes <eric@ericlbarnes.com>2012-01-04 06:28:27 +0100
commit3b376595183e0e0db5559ccbfc368c442408dca9 (patch)
tree7888ba6975f781d7e78143fc7d3a5a9a4210e1e7 /system/libraries/Pagination.php
parent8d727f14446f31d919e808e3833d252ef12cf1ae (diff)
Fixed paging with prefix and suffix for real page numbers. Refs #677 Fixes #52
Diffstat (limited to 'system/libraries/Pagination.php')
-rw-r--r--system/libraries/Pagination.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php
index 2fe4cf31b..e0cab2128 100644
--- a/system/libraries/Pagination.php
+++ b/system/libraries/Pagination.php
@@ -142,9 +142,10 @@ class CI_Pagination {
// Determine the current page number.
$CI =& get_instance();
+ // See if we are using a prefix or suffix on links
if ($this->prefix != '' OR $this->suffix != '')
{
- $this->cur_page = str_replace(array($this->prefix, $this->suffix), '', $CI->uri->segment($this->uri_segment));
+ $this->cur_page = (int) str_replace(array($this->prefix, $this->suffix), '', $CI->uri->segment($this->uri_segment));
}
if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)
@@ -154,7 +155,7 @@ class CI_Pagination {
$this->cur_page = (int) $CI->input->get($this->query_string_segment);
}
}
- elseif ($CI->uri->segment($this->uri_segment) != $base_page)
+ elseif ( ! $this->cur_page AND $CI->uri->segment($this->uri_segment) != $base_page)
{
$this->cur_page = (int) $CI->uri->segment($this->uri_segment);
}
@@ -165,7 +166,7 @@ class CI_Pagination {
$this->cur_page = $base_page;
}
- $this->num_links = (int)$this->num_links;
+ $this->num_links = (int) $this->num_links;
if ($this->num_links < 1)
{