From 2b241399a7b1978ca7992e0a0162599408fabb9b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 22 Nov 2012 13:23:25 +0200 Subject: Manually apply a fix submitted via PR #2012, #2016 --- system/libraries/Pagination.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'system') 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 -- cgit v1.2.3-24-g4f1b