#27578 [Opn->Bgs]: parse_str() quotes array keys when magic quotes are turned ON

From: Date: Fri, 12 Mar 2004 14:11:34 +0000
Subject: #27578 [Opn->Bgs]: parse_str() quotes array keys when magic quotes are turned ON
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56358@lists.php.net to get a copy of this message
ID: 27578 Updated by: iliaa@php.net Reported By: honza dot malik at ecn dot cz -Status: Open +Status: Bogus Bug Type: Strings related Operating System: Linux PHP Version: 4.3.4 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The string you pass to parse_str() should be 'a[key]=something'. When you include " in they key name they are being treated as part of the name rather then quotes in the argument. You'll encounter the same behaviour is you pass foo.php?a["key"]=something and have magic_quotes_gpc enabled. Previous Comments: ------------------------------------------------------------------------ [2004-03-12 07:10:00] honza dot malik at ecn dot cz Description: ------------ parse_str() quotes array keys when magic quotes are turned ON (it actually quotes also values, but it is probably (but unfortunatelly) desired behavior) Reproduce code: --------------- parse_str( 'a["key"]=something', $arr); print_r($arr); Expected result: ---------------- Array ( [a] => Array ( ["key"] => something ) ) or maybe Array ( [a] => Array ( [key] => something ) ) Actual result: -------------- Array ( [a] => Array ( [\"key\"] => something ) ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27578&edit=1

« previous php.bugs (#56358) next »