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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
31 - 23 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC