#42647 [NEW]: unexpected results from parse_str()
| From: | dev at glossword dot info | Date: | Wed, 12 Sep 2007 18:27:58 +0000 |
| Subject: | #42647 [NEW]: unexpected results from parse_str() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-117471@lists.php.net to get a copy of this message | ||
From: dev at glossword dot info
Operating system: Windows XP
PHP version: 5.2.4
PHP Bug Type: URL related
Bug description: unexpected results from parse_str()
Description:
------------
Hi. Before to make this post, I have read all previous bugs related to
parse_str() and user comments in documentation for parse_str()
function. Perhaps, this is not a bug but "consistent behavior"... Anyway,
it didn't work as expected and it makes a trouble for me.
Reproduce code:
---------------
$str1 = '&arg1=123&arg2="Company&Sons" '90';
$str2 = '&arg1=123&arg2="Company&Sons" \'90';
parse_str($str1, $array1);
parse_str( html_entity_decode($str1), $array2 );
parse_str($str2, $array3);
parse_str( html_entity_decode($str2), $array4 );
print_r( $array1 );
print_r( $array2 );
print_r( $array3 );
print_r( $array4 );
Expected result:
----------------
Array
(
[arg1] => 123
[arg2] => "Company&Sons" '90
)
Array
(
[arg1] => 123
[arg2] => "Company&Sons" '90
)
...
Actual result:
--------------
Array
(
[arg1] => 123
[arg2] =>
[quot;Company] =>
[amp;Sons] =>
[quot;_] =>
[#039;90] =>
)
Array
(
[arg1] => 123
[arg2] => "Company
[Sons"_] =>
[#039;90] =>
)
Array
(
[arg1] => 123
[arg2] => "Company
[Sons"_'90] =>
)
Array
(
[arg1] => 123
[arg2] => "Company
[Sons"_'90] =>
)
--
Edit bug report at http://bugs.php.net/?id=42647&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42647&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42647&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42647&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42647&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=42647&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42647&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42647&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42647&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42647&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42647&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=42647&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=42647&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42647&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42647&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42647&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42647&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42647&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42647&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42647&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42647&r=mysqlcfg