Pagination bug fix #2012

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

dmmihaylov commented Nov 20, 2012

If "reuse_query_string" is true, lib wasn't checking if there is already a "?" sign in url.

Also, a check for empty get array was missing.

@dmmihaylov dmmihaylov Pagination bug fix
If "reuse_query_string" is true, lib wasn't checking if there is already a "?" sign in url.

Also, a check for empty get array was missing.
ad80b75

@narfbg narfbg commented on an outdated diff Nov 20, 2012

system/libraries/Pagination.php
@@ -460,13 +460,14 @@ public function create_links()
// 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 (is_array($get) AND ! empty($get))
@narfbg

narfbg Nov 20, 2012

Contributor

Style guide says that && should be used instead of AND. However, after 77bd21b, you'll only need to have the ! empty($get) check here.

Also, please change the file permissions back to 644. :)

Dimitar added some commits Nov 20, 2012

Contributor

narfbg commented Nov 22, 2012

Closing, #2016 is identical.

narfbg closed this Nov 22, 2012

@nonchip nonchip pushed a commit to nonchip/CodeIgniter that referenced this pull request Jun 29, 2013

@narfbg narfbg Manually apply a fix submitted via PR #2012, #2016 926b304
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment