From: tim at digicol dot de
Operating system: Red Hat Linux 7.3
PHP version: 4.3.2
PHP Bug Type: URL related
Bug description: parse_url() missing "host" with file:// scheme

Description:
------------
parse_url() now prepends the "path" part with the hostname for "file://"
scheme URLs.

In PHP 4.3.0 and all previous versions we've used (including PHP 3),
"file://localhost/path" produced "[path] => /path".

In 4.3.2, this has become "[path] => localhost/path", which obviously
breaks any code trying to access this on the filesystem.

Please fix this in PHP 4.3.3 to keep backwards compatibility.

(Maybe this has been broken while fixing
[url]http://bugs.php.net/bug.php?id=23445[/url] ?)

Workaround:
Use "file:/path" URLs (not tested under PHP 3).
"file:///path" doesn't work in older PHP versions (PHP 4.0.6 says "PHP
Warning: unable to parse url").



Reproduce code:
---------------
<?php
print_r(parse_url('file://localhost/dir/subdir/file.txt'));
?>

Expected result:
----------------
Array
(
[scheme] => file
[host] => localhost
[path] => /dir/subdir/file.txt
)


Actual result:
--------------
Array
(
[scheme] => file
[path] => localhost/dir/subdir/file.txt
)


--
Edit bug report at [url]http://bugs.php.net/?id=24560&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=24560&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=24560&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=24560&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=24560&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=24560&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=24560&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=24560&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=24560&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=24560&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=24560&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=24560&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=24560&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=24560&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=24560&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=24560&r=gnused[/url]