cvs: php4(PHP_4_3) /ext/standard url.c /ext/standard/tests/strings url_t.phpt
| From: | Ilia Alshanetsky | Date: | Tue, 31 Dec 2002 18:54:39 +0000 |
| Subject: | cvs: php4(PHP_4_3) /ext/standard url.c /ext/standard/tests/strings url_t.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-17499@lists.php.net to get a copy of this message | ||
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 <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $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:me@mydomain.com',
'/foo.php?a=b&c=d',
'foo.php?a=b&c=d',
-'http://user:passwd@www.example.com:8080?bar=1&boom=0'
+'http://user:passwd@www.example.com: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"
}