Bug->Req #55102 [Opn]: add parameter to parse_str to avoid sanitizing of root keys

From: Date: Fri, 01 Jul 2011 23:02:06 +0000
Subject: Bug->Req #55102 [Opn]: add parameter to parse_str to avoid sanitizing of root keys
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-161482@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55102&edit=1

 ID:                 55102
 Updated by:         felipe@php.net
 Reported by:        giorgio dot liscio at email dot it
 Summary:            add parameter to parse_str to avoid sanitizing of
                     root keys
 Status:             Open
-Type:               Bug
+Type:               Feature/Change Request
 Package:            URL related
 Operating System:   Irrelevant
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

Changing to Feature request.


Previous Comments:
------------------------------------------------------------------------
[2011-07-01 09:31:45] giorgio dot liscio at email dot it

Description:
------------
hi, this is probably an old behavior to make php backward compatible when register_global was
enabled

parse_str("hey all=1",$r); ---> array('hey_all' => '1');

parse_str is now widely used in xmlhttprequest communication and may cause a lot of issues and waste
of time when debugging because we are not able to know how exactly what type of character sanitizing
is made to root keys

yep, only root keys are sanitized because

parse_str("aaa[hey all]=1",$r); ---> array('aaa' => array('hey
all', '1'));

works like expected

so my request is not to change the default behavior of this function (and how $_GET $_POST etc are
populated)

but add another parameter to this function for who wants root keys parsed without sanitizing

void parse_str ( string $str [, array &$arr ] [, bool $bwcompatible = true])

thank you



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55102&edit=1


Thread (3 messages)

« previous php.bugs (#161482) next »