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

 ID:                 63162
 Updated by:         s...@php.net
 Reported by:        franssen dot roland at gmail dot com
 Summary:            parse_url does not matches password component
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            URL related
 Operating System:   Ubuntu
 PHP Version:        5.4.7
-Assigned To:        
+Assigned To:        stas
 Block user comment: N
 Private report:     N

 New Comment:

The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------
[2012-09-25 19:18:48] franssen dot roland at gmail dot com

Description:
------------
Password component is not matched if only the authority part is given... it 
does matches however if a scheme is provided with it.

Due the difference between example 2 and 3 i'm not sure if a relative URI 
reference is supported or not.

Test script:
---------------
<?php
var_dump(parse_url('http://user:pass@host'));
var_dump(parse_url('//user:pass@host'));
var_dump(parse_url('//user@host'));

Expected result:
----------------
array(4) {
  ["scheme"]=>
  string(4) "http"
  ["host"]=>
  string(4) "host"
  ["user"]=>
  string(4) "user"
  ["pass"]=>
  string(4) "pass"
}
array(3) {
  ["host"]=>
  string(4) "host"
  ["user"]=>
  string(4) "user"
  ["pass"]=>
  string(4) "pass"
}
array(2) {
  ["host"]=>
  string(4) "host"
  ["user"]=>
  string(4) "user"
}


Actual result:
--------------
array(4) {
  ["scheme"]=>
  string(4) "http"
  ["host"]=>
  string(4) "host"
  ["user"]=>
  string(4) "user"
  ["pass"]=>
  string(4) "pass"
}
array(1) {
  ["path"]=>
  string(16) "//user:pass@host"
}
array(2) {
  ["host"]=>
  string(4) "host"
  ["user"]=>
  string(4) "user"
}


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



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

Reply via email to