Bug #66813 [NEW]: Detect some valid url as invalid in parse_url
| From: | fzerorubigd at gmail dot com | Date: | Mon, 03 Mar 2014 09:46:07 +0000 |
| Subject: | Bug #66813 [NEW]: Detect some valid url as invalid in parse_url | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-184501@lists.php.net to get a copy of this message | ||
From: fzerorubigd at gmail dot com
Operating system: Linux x64
PHP version: 5.5.9
Package: *General Issues
Bug Type: Bug
Bug description:Detect some valid url as invalid in parse_url
Description:
------------
This is the result of url like this :
var_dump(parse_url("//example.com/web:o"));
==>
array(2) {
'host' =>
string(11) "example.com"
'path' =>
string(6) "/web:o"
}
but if I replace the :o with :1 the result is false
var_dump(parse_url("//example.com/web:1"));
==>
bool(false)
Also its correct if I use the large integer value :
var_dump(parse_url("//example.com/web:1232323232"));
==>
array(2) {
'host' =>
string(11) "example.com"
'path' =>
string(15) "/web:1232323232"
}
Test script:
---------------
<?php
//Correct:
var_dump(parse_url("//example.com/web:o"));
//Incorrect:
var_dump(parse_url("//example.com/web:1"));
//Correct:
var_dump(parse_url("//example.com/web:1232323232"));
Expected result:
----------------
array(2) {
'host' =>
string(11) "example.com"
'path' =>
string(6) "/web:o"
}
array(2) {
'host' =>
string(11) "example.com"
'path' =>
string(6) "/web:1"
}
array(2) {
'host' =>
string(11) "example.com"
'path' =>
string(15) "/web:1232323232"
}
Actual result:
--------------
array(2) {
'host' =>
string(11) "example.com"
'path' =>
string(6) "/web:o"
}
bool(false)
array(2) {
'host' =>
string(11) "example.com"
'path' =>
string(15) "/web:1232323232"
}
--
Edit bug report at https://bugs.php.net/bug.php?id=66813&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66813&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66813&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66813&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66813&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66813&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66813&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66813&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66813&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66813&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66813&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66813&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66813&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66813&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66813&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66813&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66813&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66813&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66813&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66813&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66813&r=mysqlcfg