Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.1

Bug #4337 New version breaks encoding.
Submitted: 2005-05-12 21:45 UTC
From: pager dot pear dot php dot net at matt dot thoughtprocess dot n Assigned: quipo
Status: Closed Package: Pager
PHP Version: 4.3.11 OS: linux
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 30 + 43 = ?

 [2005-05-12 21:45 UTC] pager dot pear dot php dot net at matt dot thoughtprocess dot n
Description: ------------ The new version breaks a lot of my code. Reproduce code: --------------- This is one of the scripts in question: If you choose '1,000,000' for a max price and 'Brentwood' Specifically here is the original request which works with &pageID=2 appended to the end: Here is the Pager generated URL after the most recent Pager 2.3.1 that no longer works:[eq][_prop_type]=RES&s[eq][_square_footage]=+0&s[eq][_number_of_bedrooms]=+0&s[eq][_total_bathrooms]=+0&s[eq][_trans]=S&s[eq][_style]=0&s[eq][_street_number]=&s[eq][_street_name]=&s[eq][_subdivision]=&s[eq][_zip]=&s[eq][_last_updated_date]=+0&s[btw][_list_price][low]=0&s[btw][_list_price][high]=1000000&s[in][_area][0]=211&s[in][_city][0]=0&submit=Show%20Properties&pageID=2 Here is my external fix to take care of this problem: // Page nav links $links = $pager->getLinks(); foreach(array_keys($links) as $key) { $links[$key]=preg_replace('/\[/', "%5B", $links[$key]); $links[$key]=preg_replace('/\]/', "%5D", $links[$key]); $links[$key]=preg_replace('/\+/', "%2B", $links[$key]); }


 [2005-05-12 22:17 UTC] pager dot pear dot php dot net at matt dot thoughtprocess dot n
After my original submission I realized I needed two more lines to correct the first and last links in the array that have brackets around the page numbers. This is such a dirty hack. :) // Page nav links $links = $pager->getLinks(); foreach(array_keys($links) as $key) { $links[$key]=preg_replace('/\[/', "%5B", $links[$key]); $links[$key]=preg_replace('/\]/', "%5D", $links[$key]); $links[$key]=preg_replace('/\+/', "%2B", $links[$key]); $links[$key]=preg_replace('/\>\%5B/', ">[", $links[$key]); $links[$key]=preg_replace('/\%5D\</', "]<", $links[$key]); }
 [2005-05-31 18:21 UTC] quipo
Hi, what's the problem, exactly? I can't find any issue. The square bracket should be a valid url char AFAIK. Can you send me a script reproducing your problem? TIA
 [2005-07-04 08:44 UTC] quipo
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on In case this was a website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.