From:             franssen dot roland at gmail dot com
Operating system: Ubuntu
PHP version:      5.4.7
Package:          URL related
Bug Type:         Bug
Bug description:parse_url does not matches password component

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 bug report at https://bugs.php.net/bug.php?id=63162&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63162&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63162&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63162&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63162&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63162&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63162&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63162&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63162&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63162&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63162&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63162&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63162&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63162&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63162&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63162&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63162&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63162&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63162&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63162&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63162&r=mysqlcfg

Reply via email to