From: Ilia Alshanetsky Date: Mon, 21 Jul 2003 13:37:10 +0000 (+0000) Subject: MFH: Fixed bug #24560 (parse_url() incorrectly handling certain file:// X-Git-Tag: php-4.3.3RC2~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e941298e5519cbc2d1f089955b385024c3c1e169;p=php MFH: Fixed bug #24560 (parse_url() incorrectly handling certain file:// based schemas). --- diff --git a/NEWS b/NEWS index eeb90aaf0d..8a345747b7 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ PHP 4 NEWS is used for background color. (Pierre-Alain Joye) - Fixed bug #24640 (var_export and var_dump can't output large float). (Marcus) - Fixed bug #24573 (debug_backtrace() crashes if $this set to null). (Jani) +- Fixed bug #24560 (parse_url() incorrectly handling certain file:// based + schemas). Ilia - Fixed bug #24537 (apache2 compile misses some include directories). (Jani) - Fixed bug #24519 (aggregate_methods_by_list() does not increment refcount). - Fixed bug #24313 (file_exist() warning on non-existent files when diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt index 29ee7fb48e..f3bd83819c 100644 --- a/ext/standard/tests/strings/url_t.phpt +++ b/ext/standard/tests/strings/url_t.phpt @@ -625,11 +625,13 @@ array(2) { ["path"]=> string(13) "/path/to/file" } -array(2) { +array(3) { ["scheme"]=> string(4) "file" + ["host"]=> + string(4) "path" ["path"]=> - string(12) "path/to/file" + string(8) "/to/file" } array(2) { ["scheme"]=> diff --git a/ext/standard/url.c b/ext/standard/url.c index 99a6c5df60..3490981038 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -125,7 +125,9 @@ PHPAPI php_url *php_url_parse(char *str) if (*(e+2) == '/') { s = e + 3; if (!strncasecmp("file", ret->scheme, sizeof("file"))) { - goto nohost; + if (*(e + 3) == '/') { + goto nohost; + } } } else { s = e + 1;