iliaa Tue Dec 31 13:54:39 2002 EDT Modified files: (Branch: PHP_4_3) /php4/ext/standard url.c /php4/ext/standard/tests/strings url_t.phpt Log: MFH Index: php4/ext/standard/url.c diff -u php4/ext/standard/url.c:1.58.2.4 php4/ext/standard/url.c:1.58.2.5 --- php4/ext/standard/url.c:1.58.2.4 Tue Dec 31 11:35:35 2002 +++ php4/ext/standard/url.c Tue Dec 31 13:54:38 2002 @@ -15,7 +15,7 @@ | Author: Jim Winstead <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: url.c,v 1.58.2.4 2002/12/31 16:35:35 sebastian Exp $ */ +/* $Id: url.c,v 1.58.2.5 2002/12/31 18:54:38 iliaa Exp $ */ #include <stdlib.h> #include <string.h> @@ -124,6 +124,9 @@ if (*(e+2) == '/') { s = e + 3; + if (!strncasecmp("file", ret->scheme, sizeof("file"))) +{ + goto nohost; + } } else { s = e + 1; if (!strncasecmp("file", ret->scheme, sizeof("file"))) { Index: php4/ext/standard/tests/strings/url_t.phpt diff -u php4/ext/standard/tests/strings/url_t.phpt:1.3.2.2 php4/ext/standard/tests/strings/url_t.phpt:1.3.2.3 --- php4/ext/standard/tests/strings/url_t.phpt:1.3.2.2 Mon Dec 30 11:43:31 2002 +++ php4/ext/standard/tests/strings/url_t.phpt Tue Dec 31 13:54:38 2002 @@ -64,7 +64,10 @@ 'mailto:[EMAIL PROTECTED]', '/foo.php?a=b&c=d', 'foo.php?a=b&c=d', -'http://user:[EMAIL PROTECTED]:8080?bar=1&boom=0' +'http://user:[EMAIL PROTECTED]:8080?bar=1&boom=0', +'file:///path/to/file', +'file://path/to/file', +'file:/path/to/file' ); foreach ($sample_urls as $url) { @@ -615,4 +618,22 @@ string(6) "passwd" ["query"]=> string(12) "bar=1&boom=0" +} +array(2) { + ["scheme"]=> + string(4) "file" + ["path"]=> + string(13) "/path/to/file" +} +array(2) { + ["scheme"]=> + string(4) "file" + ["path"]=> + string(12) "path/to/file" +} +array(2) { + ["scheme"]=> + string(4) "file" + ["path"]=> + string(13) "/path/to/file" }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php