diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-11-22 12:23:25 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-11-22 12:23:25 +0100 |
commit | 2b241399a7b1978ca7992e0a0162599408fabb9b (patch) | |
tree | 4a9bfdb67cdf53394864da4ad724753583b41ed9 /system/libraries/Pagination.php | |
parent | 7ade8b7944d10f4fd1583789309cf003a3eac6f7 (diff) |
Manually apply a fix submitted via PR #2012, #2016
Diffstat (limited to 'system/libraries/Pagination.php')
-rw-r--r-- | system/libraries/Pagination.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/system/libraries/Pagination.php b/system/libraries/Pagination.php index ae8dba072..66b341760 100644 --- a/system/libraries/Pagination.php +++ b/system/libraries/Pagination.php @@ -460,13 +460,15 @@ class CI_Pagination { // Unset the controll, method, old-school routing options unset($get['c'], $get['m'], $get[$this->query_string_segment]); - if ( ! $get) $get = array(); - - // Put everything else onto the end - $query_string = (strpos($this->base_url, '&') !== FALSE ? '&' : '?') . http_build_query($get, '', '&'); + if ( ! empty($get)) + { + // Put everything else onto the end + $query_string = (strpos($this->base_url, '?') !== FALSE ? '&' : '?') + .http_build_query($get, '', '&'); - // Add this after the suffix to put it into more links easily - $this->suffix .= $query_string; + // Add this after the suffix to put it into more links easily + $this->suffix .= $query_string; + } } // Render the "First" link |