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

Bug #704 Hardcoded & instead of ini_get('arg_separator.xxx')
Submitted: 2004-02-07 14:51 UTC
From: miancule at yahoo dot com Assigned: richard
Status: Closed Package: Net_URL
PHP Version: 4.3.4 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2004-02-07 14:51 UTC] miancule at yahoo dot com
Description: ------------ A small thing, but essential for XHTML compliancy (& instead of & in URLs), etc Instead of using harcoded & as argument separator, the code should use ini_get('arg_separator.input') and ini_get('arg_separator.output'). Changes to URL.php: Line 272: $querystring = implode('&', $querystring); becomes: $querystring = implode(ini_get('arg_separator.output'), $querystring); Line 289: $parts = preg_split('/&/', $querystring, -1, PREG_SPLIT_NO_EMPTY); becomes: $parts = preg_split('/'.preg_quote(ini_get('arg_separator.input'),'/').'/', $querystring, -1, PREG_SPLIT_NO_EMPTY); Regards, mihai Reproduce code: --------------- <?php ini_set('arg_separator.output', '&'); require_once 'Net/URL.php'; $url = &new NetURL('http://foo.bar/index.php'); $url->addQueryString('apples', 5); $url->addQueryString('oranges', 15); echo $url->getURL(); die; ?> Expected result: ---------------- The output of the $url->getURL() call should be: http://foo.bar/index.php?apples=5&oranges=15 Actual result: -------------- The output of the $url->getURL() call is: http://foo.bar/index.php?apples=5&oranges=15

Comments

 [2004-04-23 00:40 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-05-08 17:32 UTC] richard at phpguru dot org
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/packages.php
 [2004-07-12 16:12 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-09-02 21:27 UTC] joern_h at gmx dot net
I think the value of arg_separator.output should not be used since its a setting that applies to the server the script is running on. If you connect to a different server it may need a different separator. Perhaps the separator should be settable by a method and default to '&'.
 [2005-03-07 04:20 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-03-07 14:17 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!