cvs: php4 /ext/standard url.c
| From: | Ilia Alshanetsky | Date: | Thu, 17 Oct 2002 13:59:56 +0000 |
| Subject: | cvs: php4 /ext/standard url.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-14994@lists.php.net to get a copy of this message | ||
iliaa Thu Oct 17 09:59:56 2002 EDT
Modified files:
/php4/ext/standard url.c
Log:
Added support for file:/. Thanks to Thies for noticing the problem.
Index: php4/ext/standard/url.c
diff -u php4/ext/standard/url.c:1.55 php4/ext/standard/url.c:1.56
--- php4/ext/standard/url.c:1.55 Sat Oct 12 12:09:01 2002
+++ php4/ext/standard/url.c Thu Oct 17 09:59:55 2002
@@ -15,7 +15,7 @@
| Author: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: url.c,v 1.55 2002/10/12 16:09:01 iliaa Exp $ */
+/* $Id: url.c,v 1.56 2002/10/17 13:59:55 iliaa Exp $ */
#include <stdlib.h>
#include <string.h>
@@ -94,10 +94,15 @@
ue = s + length;
/* parse scheme */
- if ((e = strchr(s, ':')) && *(e+1) == '/' && *(e+2) ==
'/' && (e-s)) {
+ if ((e = strchr(s, ':')) && *(e+1) == '/' && (e-s)) {
ret->scheme = estrndup(s, (e-s));
php_replace_controlchars(ret->scheme);
- s = e + 3;
+
+ if (*(e+2) == '/') {
+ s = e + 3;
+ } else {
+ s = e + 2;
+ }
} else if (e) { /* no scheme, look for port */
p = e + 1;
pp = p;