cvs: pear /Pager Common.php package.xml /Pager/tests pager_test.php
| From: | Lorenzo Alberton | Date: | Wed, 07 Jun 2006 11:33:00 +0000 |
| Subject: | cvs: pear /Pager Common.php package.xml /Pager/tests pager_test.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-40550@lists.php.net to get a copy of this message | ||
quipo Wed Jun 7 11:33:00 2006 UTC
Modified files:
/pear/Pager Common.php package.xml
/pear/Pager/tests pager_test.php
Log:
fix double escaping of arg_separator when php.ini's arg_separator.output =
"&"
(thanks to Csaba Kiss)
http://cvs.php.net/viewcvs.cgi/pear/Pager/Common.php?r1=1.54&r2=1.55&diff_format=u
Index: pear/Pager/Common.php
diff -u pear/Pager/Common.php:1.54 pear/Pager/Common.php:1.55
--- pear/Pager/Common.php:1.54 Fri Apr 21 13:27:02 2006
+++ pear/Pager/Common.php Wed Jun 7 11:33:00 2006
@@ -33,7 +33,7 @@
* @author Richard Heyes <richard@phpguru.org>
* @copyright 2003-2006 Lorenzo Alberton, Richard Heyes
* @license http://www.debian.org/misc/bsd.license BSD
License (3 Clause)
- * @version CVS: $Id: Common.php,v 1.54 2006/04/21 13:27:02 quipo Exp $
+ * @version CVS: $Id: Common.php,v 1.55 2006/06/07 11:33:00 quipo Exp $
* @link http://pear.php.net/package/Pager
*/
@@ -1293,6 +1293,10 @@
function __http_build_query($array, $name)
{
$tmp = array ();
+ $separator = ini_get('arg_separator.output');
+ if ($separator == '&') {
+ $separator = '&'; //the string is escaped by htmlentities anyway...
+ }
foreach ($array as $key => $value) {
if (is_array($value)) {
//array_push($tmp, $this->__http_build_query($value, sprintf('%s[%s]',
$name, $key)));
@@ -1305,7 +1309,7 @@
array_push($tmp, $this->__http_build_query(get_object_vars($value),
$name.'%5B'.$key.'%5D'));
}
}
- return implode(ini_get('arg_separator.output'), $tmp);
+ return implode($separator, $tmp);
}
// }}}
http://cvs.php.net/viewcvs.cgi/pear/Pager/package.xml?r1=1.76&r2=1.77&diff_format=u
Index: pear/Pager/package.xml
diff -u pear/Pager/package.xml:1.76 pear/Pager/package.xml:1.77
--- pear/Pager/package.xml:1.76 Mon May 22 10:29:26 2006
+++ pear/Pager/package.xml Wed Jun 7 11:33:00 2006
@@ -26,10 +26,11 @@
<release>
<version>2.4.2</version>
- <date>2006-05-20</date>
+ <date>2006-06-07</date>
<state>stable</state>
<notes>
<![CDATA[
+- fix double escaping of arg_separator when php.ini's arg_separator.output =
"&"
]]>
</notes>
@@ -78,10 +79,11 @@
<changelog>
<release>
<version>2.4.2</version>
- <date>2006-05-20</date>
+ <date>2006-06-07</date>
<state>stable</state>
<notes>
<![CDATA[
+- fix double escaping of arg_separator when php.ini's arg_separator.output =
"&"
]]>
</notes>
</release>
http://cvs.php.net/viewcvs.cgi/pear/Pager/tests/pager_test.php?r1=1.20&r2=1.21&diff_format=u
Index: pear/Pager/tests/pager_test.php
diff -u pear/Pager/tests/pager_test.php:1.20 pear/Pager/tests/pager_test.php:1.21
--- pear/Pager/tests/pager_test.php:1.20 Fri Apr 21 13:27:02 2006
+++ pear/Pager/tests/pager_test.php Wed Jun 7 11:33:00 2006
@@ -1,5 +1,5 @@
<?php
-// $Id: pager_test.php,v 1.20 2006/04/21 13:27:02 quipo Exp $
+// $Id: pager_test.php,v 1.21 2006/06/07 11:33:00 quipo Exp $
require_once 'simple_include.php';
require_once 'pager_include.php';
@@ -206,8 +206,9 @@
*/
$expected = $options['extraVars'];
$this->assertEqual($expected, $this->pager->_getLinksData());
+ $separator = ini_get('arg_separator.output');
- $expected = '<a
href="'.$_SERVER['PHP_SELF'].'?arr%5B0%5D=apple&arr%5B1%5D=orange&no=test&pageID=2"
title=""></a>';
+ $expected = '<a
href="'.$_SERVER['PHP_SELF'].'?arr%5B0%5D=apple'.$separator.'arr%5B1%5D=orange'.$separator.'no=test'.$separator.'pageID=2"
title=""></a>';
$actual = $this->pager->_renderLink('', '');
$this->assertEqual($expected, $actual);
}
@@ -231,8 +232,8 @@
);
$actual = $this->pager->_getLinksData();
$this->assertEqual($expected, $this->pager->_getLinksData());
-
- $expected = '<a
href="'.$_SERVER['PHP_SELF'].'?arr%5B0%5D=apple&arr%5B1%5D=orange&pageID=2"
title=""></a>';
+ $separator = ini_get('arg_separator.output');
+ $expected = '<a
href="'.$_SERVER['PHP_SELF'].'?arr%5B0%5D=apple'.$separator.'arr%5B1%5D=orange'.$separator.'pageID=2"
title=""></a>';
$actual = $this->pager->_renderLink('', '');
$this->assertEqual($expected, $actual);
}