Bug #75041 [NEW]: parse_url() fails if URL/URI ends like /foo:123
| From: | k-gun at mail dot com | Date: | Sun, 06 Aug 2017 19:19:57 +0000 |
| Subject: | Bug #75041 [NEW]: parse_url() fails if URL/URI ends like /foo:123 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-210536@lists.php.net to get a copy of this message | ||
From: k-gun at mail dot com
Operating system: Ubuntu 16.04.3 LTS
PHP version: 7.1.8
Package: *URL Functions
Bug Type: Bug
Bug description:parse_url() fails if URL/URI ends like /foo:123
Description:
------------
When passing a URL/URI to parse_url() like "/foo/a:1" then false is
returning.
Causing fail parameter pattern: ^.*/[any]*[colon][digit]{1,5}$.
Test script:
---------------
$params = ["/a:1", "/a:11", "/a:111", "/a:1111",
"/a:11111",
"/a:111111", "/a", "/a:", "/a:b", "/a:b:",
"/a:b:1"];
foreach ($params as $param) {
$result = parse_url($param);
if ($result === false) {
printf("Failed: %s\n", $param);
} else {
printf("Passed: %s\n", $param);
}
}
---
Failed: /a:1
Failed: /a:11
Failed: /a:111
Failed: /a:1111
Failed: /a:11111
Passed: /a:111111
Passed: /a
Passed: /a:
Passed: /a:b
Passed: /a:b:
Passed: /a:b:1
--
Edit bug report at https://bugs.php.net/bug.php?id=75041&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75041&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75041&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75041&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75041&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75041&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75041&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75041&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75041&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75041&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75041&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75041&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75041&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75041&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75041&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75041&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75041&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75041&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75041&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75041&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75041&r=mysqlcfg