Ask a Question related to PHP Development, Design and Development.
-
tim at digicol dot de #1
#24560 [NEW]: parse_url() missing "host" with file:// scheme
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]
tim at digicol dot de Guest
-
#26218 [Fbk->Opn]: mail() sends extra "RCPT TO: <>" to smtp host
ID: 26218 User updated by: bzheng at us dot nomura dot com Reported By: bzheng at us dot nomura dot com -Status: ... -
#24560 [Asn->Csd]: parse_url() missing "host" with file:// scheme
ID: 24560 Updated by: iliaa@php.net Reported By: tim at digicol dot de -Status: Assigned +Status: ... -
#24560 [Opn->Asn]: parse_url() missing "host" with file:// scheme
ID: 24560 Updated by: sniper@php.net Reported By: tim at digicol dot de -Status: Open +Status: ... -
How to make the "search text" feature work with non "txt" file
On Fri, 27 Jun 2003 07:19:23 -0700, "Juergen" <anhorn@bktel.com> wrote: See MVP Doug Knox' comments and fix here:... -
"sendmail_from" not set in php.ini or custom "From:" header missing
Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 14 Message-ID:...



Reply With Quote

