php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75041 parse_url() fails if URL/URI ends like /foo:123
Submitted: 2017-08-06 19:19 UTC Modified: 2017-08-06 21:29 UTC
From: k-gun at mail dot com Assigned:
Status: Duplicate Package: URL related
PHP Version: 7.1.8 OS: Ubuntu 16.04.3 LTS
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: k-gun at mail dot com
New email:
PHP Version: OS:

 

 [2017-08-06 19:19 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-08-06 21:29 UTC] requinix@php.net
-Status: Open +Status: Duplicate -Package: *URL Functions +Package: URL related
 [2017-08-06 21:29 UTC] requinix@php.net
Duplicate of bug #71646
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 08:01:29 2024 UTC