Bug #74780 [Asn->Csd]: parse_url() borken when query string contains colon

From: Date: Thu, 22 Jun 2017 10:53:45 +0000
Subject: Bug #74780 [Asn->Csd]: parse_url() borken when query string contains colon
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209623@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74780&edit=1

 ID:                 74780
 Updated by:         krakjoe@php.net
 Reported by:        dm@php.net
 Summary:            parse_url() borken when query string contains colon
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            URL related
 PHP Version:        7.2.0alpha1
 Assigned To:        jhdxr
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of jhdxr
Revision: http://git.php.net/?p=php-src.git;a=commit;h=db287b23030a2ac16bd9e2524d7e8bbe1b4a4d9a
Log: fix bug #74780 parse_url() borken when query string contains colon


Previous Comments:
------------------------------------------------------------------------
[2017-06-19 12:13:12] dm@php.net

Description:
------------
When query string contains : (colon) parse_url() fails parses relative URIs improperly (like it
happened before 5.4.7).

For 5.6 or older: If query string contains e.g. a=1:337 then port will be
337, when it's e.g. a=b:c then the port is correct.

https://3v4l.org/aBfGB

Test script:
---------------
<?php

var_dump(
    parse_url('//php.net/manual/en/function.parse-url.php?v=1:337')
);

Expected result:
----------------
array(3) {
  ["host"]=>
  string(7) "php.net"
  ["path"]=>
  string(33) "/manual/en/function.parse-url.php"
  ["query"]=>
  string(7) "v=1:337"
}

Actual result:
--------------
array(2) {
  ["path"]=>
  string(42) "//php.net/manual/en/function.parse-url.php"
  ["query"]=>
  string(7) "v=1:337"
}


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74780&edit=1


Thread (3 messages)

« previous php.bugs (#209623) next »