|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #29799 extract performs urldecode?
Submitted: 2004-08-23 17:04 UTC Modified: 2004-12-30 09:56 UTC
From: cpuidle at gmx dot de Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.0.1 OS: WinXP SP2
Private report: No CVE-ID: None
 [2004-08-23 17:04 UTC] cpuidle at gmx dot de
Running this code:


the resulting (global) variables are url-decoded. I found that $_REQUEST is already url-decoded and couldn't find any documentation?

Reproduce code:

Expected result:
make clean when url-decoding is performed.

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-29 18:44 UTC]
It's true that nowhere is it mentioned that any variables from outside PHP will be automatically urldecode()'ed... but isn't this expected behaviour? When you pass a variable, whether through POST, GET or Cookies, don't you want that variable to be as it was sent, rather than encoded?

I know this might be confusing for people coming from other languages (such as Perl), but doesn't it make sense to have it that way?
 [2004-12-30 09:56 UTC]
extract() doesn't perform urldecode() as proves this test case:

extract(array("a" => "%70"));
echo $a; // %70

$_REQUEST and similar variables already contain urldecoded data.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jun 15 11:01:24 2021 UTC