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

Bug #2989 Wrong parsing of arrays in QUERY_STRING
Submitted: 2004-12-19 14:46 UTC
From: support at infinity dot com dot ua Assigned: quipo
Status: Bogus Package: Pager
PHP Version: 5.0.2 OS: Windows XP SP2
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 : 42 + 36 = ?

 
 [2004-12-19 14:46 UTC] support at infinity dot com dot ua
Description: ------------ If QUERY_STRING contains arrays, they are being overencoded. This can be fixed by adding $name = rawurldecode($name); after line 637 (//check for arrays in parameters: site.php?foo[]=1&foo[]=2&foo[]=3) in Common.php. Reproduce code: --------------- <html> <head> <title>PEAR::Pager bug demonstration</title> </head> <body> <?php if (empty($_GET)) { ?> <form method="get"> <input type="text" name="foo[bar]" value="test" /> <input type="submit" /> </form> <?php } else { require_once 'Pager/Pager.php'; //create dummy array of data $myData = array(); for ($i=0; $i < 200; $i++) { $myData[] = $i; } $params = array( 'itemData' => $myData, ); $pager = & Pager::factory($params); $page_data = $pager->getPageData(); $links = $pager->getLinks(); echo 'Try to browse the pages and watch the QUERY_STRING messes up.<br/ >'; echo $links['all']; echo '<pre>'; var_dump($_GET); echo '</pre>'; } ?> </body> </html>

Comments

 [2004-12-19 15:50 UTC] quipo
Thank you for taking the time to report a problem with the package. Unfortunately you are not using a current version of the package -- the problem might already be fixed. Please download a new version from http://pear.php.net/packages.php If you are able to reproduce the bug with one of the latest versions, please change the package version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR. -- Latest CVS code already has a check for urlencoded arrays. Please always check the repository before submitting a new bug report.