Bug #54759 [NEW]: parse_url function turns a tab character into an underscore
| From: | alexander_leroux at mcafee dot com | Date: | Mon, 16 May 2011 20:07:21 +0000 |
| Subject: | Bug #54759 [NEW]: parse_url function turns a tab character into an underscore | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-160767@lists.php.net to get a copy of this message | ||
From:
Operating system: Windows Server 2008 R2
PHP version: 5.3.6
Package: HTTP related
Bug Type: Bug
Bug description:parse_url function turns a tab character into an underscore
Description:
------------
The parse_url function turns the tab character into an underscore. This
turns an invalid URL into a valid one. If you are attempting to validate
user input with parse_url then it will pass validation even though tab is
an invalid character in a host name or FQDN. It may be difficult to see in
the example below but there is a tab.
Test script:
---------------
<?php
$host = "http://test url";
var_dump(parse_url($host));
?>
Expected result:
----------------
array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(8)
"test url" }
or
array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(8)
"test\turl" }
Actual result:
--------------
array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(8)
"test_url" }
--
Edit bug report at http://bugs.php.net/bug.php?id=54759&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54759&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54759&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54759&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54759&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54759&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54759&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54759&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54759&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54759&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54759&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54759&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54759&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54759&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54759&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54759&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54759&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54759&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54759&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54759&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54759&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54759&r=mysqlcfg