PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » Pager » Bug #2989

Wrong parsing of arrays in QUERY_STRING

Details

Submitted2004-12-19 14:46 UTC
Fromsupport at infinity dot com dot ua
Assignedquipo
StatusBogus
PackagePager
PHP Version5.0.2
OSWindows XP SP2
Roadmaps(Not assigned)

Comments

[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>