#20420 [Com]: parse_url broken on partial URLs

From: Date: Tue, 31 Dec 2002 08:59:10 +0000
Subject: #20420 [Com]: parse_url broken on partial URLs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-28835@lists.php.net to get a copy of this message
ID: 20420 Comment by: polone@townnews.com Reported By: pallo-php@initio.no Status: Closed Bug Type: URL related Operating System: Linux PHP Version: 4.3.0-pre2 Assigned To: ilia New Comment: As a result of this bug, has the function been changed to now parse file:///path/to/file as: Array(2) ( ["scheme"] => 'file' ["host"] => '/path/to/file' ) That seems incorrect, as it use to: Array(2) ( ["scheme"] => 'file' ["path"] => '/path/to/file' ) Which is correct, and how the function use to behave. If anything, the ["host"] should state "localhost". Needless to say, this should be now documented in the function manual if this is going to be the way it works. Previous Comments: ------------------------------------------------------------------------ [2002-11-14 07:46:28] iliaa@php.net 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 http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. 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. ------------------------------------------------------------------------ [2002-11-14 03:13:06] derick@php.net Assinging to Ilia ------------------------------------------------------------------------ [2002-11-14 02:56:30] pallo-php@initio.no In 4.2.x, parsing the partial URL "/foo.php?a=b&c=d" returned array(2) { ["path"]=> string(8) "/foo.php" ["query"]=> string(7) "a=b&c=d" } but in 4.3.0-pre2 the query part is not recognized an parse_url() return array(1) { ["path"]=> string(16) "/foo.php?a=b&c=d" } The parse_url() function also have problems with URLs like "file:///foo.txt", where the host is absent, and "mailto:user@domain". Both URLs were handled properly in 4.2.x ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20420&edit=1

« previous php.bugs (#28835) next »