For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > December 2004 > #29799 [Opn->Bgs]: extract performs urldecode?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #29799 [Opn->Bgs]: extract performs urldecode?
vrana@php.net

2004-12-30, 8:56 am

ID: 29799
Updated by: vrana@php.net
Reported By: cpuidle at gmx dot de
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: WinXP SP2
PHP Version: 5.0.1
New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2004-12-29 18:44:35] 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-08-23 17:04:04] 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:
--------------
..


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


--
Edit this bug report at http://bugs.php.net/?id=29799&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com