php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cpuidle at gmx dot de
New email:
PHP Version: OS:

 

 [2004-08-23 17:04 UTC] cpuidle at gmx dot de
Description:
------------
Running this code:

extract($_REQUEST);

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:
--------------
.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-29 18:44 UTC] mez@php.net
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] vrana@php.net
extract() doesn't perform urldecode() as proves this test case:

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

$_REQUEST and similar variables already contain urldecoded data.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 08:01:34 2025 UTC