Ask a Question related to PHP Development, Design and Development.
-
iliaa@php.net #1
#24560 [Asn->Csd]: parse_url() missing "host" with file:// scheme
ID: 24560
Updated by: [email]iliaa@php.net[/email]
Reported By: tim at digicol dot de
-Status: Assigned
+Status: Closed
Bug Type: URL related
Operating System: *
PHP Version: 4.3.3RC2-dev
Assigned To: iliaa
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at [url]http://snaps.php.net/[/url].
In case this was a documentation problem, the fix will show up soon at
[url]http://www.php.net/manual/[/url].
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-07-09 17:11:44] [email]sniper@php.net[/email]
Ilia, you have been touching this a lot..
file://localhost/some/path == file:///some/path
ie. They should both produce same path: /some/path ??
(and the // one should have host set too)
(at least that's how I interpret this:
[url]http://www.w3.org/Addressing/URL/4_1_File.html[/url])
------------------------------------------------------------------------
[2003-07-09 06:31:06] tim at digicol dot de
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 this bug report at [url]http://bugs.php.net/?id=24560&edit=1[/url]
iliaa@php.net 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 [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: ... -
#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... -
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

