Bug #74281 [Com]: parse_url returns false

From: Date: Sat, 20 Mar 2021 09:31:13 +0000
Subject: Bug #74281 [Com]: parse_url returns false
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232897@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74281&edit=1

 ID:                 74281
 Comment by:         djavolak at mail dot ru
 Reported by:        alex at 2sun dot su
 Summary:            parse_url returns false
 Status:             Duplicate
 Type:               Bug
 Package:            URL related
 PHP Version:        7.1.3
 Block user comment: N
 Private report:     N

 New Comment:

confirmed as well on PHP 8.0.2

everything with semicolon after the scheme makes it return false.


Previous Comments:
------------------------------------------------------------------------
[2017-03-21 11:53:53] daverandom@php.net

Previous bug: https://bugs.php.net/bug.php?id=73192

------------------------------------------------------------------------
[2017-03-21 11:41:48] requinix@php.net

The URL is invalid: the password needs to be percent-encoded. It worked in previous versions due to
a bug.

------------------------------------------------------------------------
[2017-03-21 11:37:52] alex at 2sun dot su

Description:
------------
URL like this:

scheme://example_login:!#Password?@ZZZ@127.0.0.1/some_path

parse_url returns false in PHP 7.1.3, 7.0.14, 5.6.29 (I have this versions available)

But all works as expected in PHP 7.0.5, 5.6.20

Test script:
---------------
var_dump( parse_url("scheme://example_login:!#Password?@ZZZ@127.0.0.1/some_path") );

Expected result:
----------------
array(5) {
  ["scheme"]=>
  string(6) "scheme"
  ["host"]=>
  string(9) "127.0.0.1"
  ["user"]=>
  string(13) "example_login"
  ["pass"]=>
  string(15) "!#Password?@ZZZ"
  ["path"]=>
  string(10) "/some_path"
}


Actual result:
--------------
bool(false)


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



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


Thread (5 messages)

« previous php.bugs (#232897) next »