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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Thu Oct 31 23:01:28 2024 UTC