PHP 4.0 Bug #3498: urldecode() weird behaviour
| From: | adam at nwmedia dot com dot au | Date: | Wed, 16 Feb 2000 12:14:19 +0000 |
| Subject: | PHP 4.0 Bug #3498: urldecode() weird behaviour | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-15569@lists.php.net to get a copy of this message | ||
From: adam@nwmedia.com.au
Operating system: Redhat Linux
PHP version: 4.0 Beta 3
PHP Bug Type: Misbehaving function
Bug description: urldecode() weird behaviour
<?
$url="http://165.91.107.37/mp3/s/Smashing%20Pumpkins%20-Today.mp3";
echo "1:$url\n";
echo "2:".urldecode($url)."\n";
echo "3:$url\n";
?>
Running this script will make the problem self-explanatory.
urldecode($url) should not touch the variable $url, but
it does actually work on the variable itself rather than returning the decoded URL.
as well as that, the decoded URL has part of the original URL concatenated to the end of it, like it
has overwritten the old variable space.