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
http://bugs.php.net/bug.php?id=23445 ?)

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

Reply via email to