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)    
Subscription  
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:
MUST BE VALID
Solve the problem : 32 + 4 = ?

 
 [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: http://cbp1.com/listings_search.php 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: http://cbp1.com/listings_search.php?action=search&s%5Beq%5D%5B_prop_type%5D=RES&s%5Bbtw%5D%5B_list_price%5D%5Blow%5D=0&s%5Bbtw%5D%5B_list_price%5D%5Bhigh%5D=1000000&s%5Beq%5D%5B_square_footage%5D=%2B0&s%5Beq%5D%5B_number_of_bedrooms%5D=%2B0&s%5Beq%5D%5B_total_bathrooms%5D=%2B0&s%5Beq%5D%5B_trans%5D=S&s%5Bin%5D%5B_area%5D%5B%5D=211&s%5Bin%5D%5B_city%5D%5B%5D=0&s%5Beq%5D%5B_style%5D=0&s%5Beq%5D%5B_street_number%5D=&s%5Beq%5D%5B_street_name%5D=&s%5Beq%5D%5B_subdivision%5D=&s%5Beq%5D%5B_zip%5D=&s%5Beq%5D%5B_last_updated_date%5D=%2B0&submit=Show+Properties&pageID=2 Here is the Pager generated URL after the most recent Pager 2.3.1 that no longer works: http://cbp1.com/listings_search.php?action=search&s[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]); }

Comments

 [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 pear.php.net. In case this was a pear.php.net 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.