note 75954 rejected from function.http-parse-params by mike

From: Date: Thu, 28 Jun 2007 17:35:24 +0000
Subject: note 75954 rejected from function.http-parse-params by mike
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-128059@lists.php.net to get a copy of this message
Note Submitter: Siegfried Gevatter rainct at ubuntuwire dot com ---- I found a little problem on the function I previously posted here, getParser(): PHP replacing all dots in the key with _'s, so following change would be needed to be done in the function: Replace: <?PHP $gets[$name] = $value; ?> With: <?PHP $gets[str_replace('.', '_', $name)] = urldecode($value); ?> But actually, arpad (on ##php @ irc.freenode.net) let me notice that it's so, but not if something is between [ and ], so ?var.one[var.two]=hi would become $_GET['var_one[var.two]']. Because of this, as he said, following line should go there instead: <?PHP $gets[preg_replace("/\.(?=[^\]]*(?:\[|\z))/", '_', $name)] = urldecode($value); ?>

« previous php.notes (#128059) next »