Bug #75041 [Opn->Dup]: parse_url() fails if URL/URI ends like /foo:123
| From: | requinix@php.net | Date: | Sun, 06 Aug 2017 21:29:13 +0000 |
| Subject: | Bug #75041 [Opn->Dup]: parse_url() fails if URL/URI ends like /foo:123 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210538@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75041&edit=1
ID: 75041
Updated by: requinix@php.net
Reported by: k-gun at mail dot com
Summary: parse_url() fails if URL/URI ends like /foo:123
-Status: Open
+Status: Duplicate
Type: Bug
-Package: *URL Functions
+Package: URL related
Operating System: Ubuntu 16.04.3 LTS
PHP Version: 7.1.8
Block user comment: N
Private report: N
New Comment:
Duplicate of bug #71646
Previous Comments:
------------------------------------------------------------------------
[2017-08-06 19:19:55] k-gun at mail dot com
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 this bug report at https://bugs.php.net/bug.php?id=75041&edit=1