pollita Mon Dec 15 01:54:32 2003 EDT Modified files: /php-src/ext/standard url.c Log: Scan for : in host:port pair from right instead of left. This will allow handling of http://[fe80::1]:443/foo.html IPv6 Numeric addressing with port number to parse correctly. Index: php-src/ext/standard/url.c diff -u php-src/ext/standard/url.c:1.73 php-src/ext/standard/url.c:1.74 --- php-src/ext/standard/url.c:1.73 Wed Dec 3 19:14:39 2003 +++ php-src/ext/standard/url.c Mon Dec 15 01:54:31 2003 @@ -15,7 +15,7 @@ | Author: Jim Winstead <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: url.c,v 1.73 2003/12/04 00:14:39 iliaa Exp $ */ +/* $Id: url.c,v 1.74 2003/12/15 06:54:31 pollita Exp $ */ #include <stdlib.h> #include <string.h> @@ -200,7 +200,11 @@ } /* check for port */ - if ((p = memchr(s, ':', (e-s)))) { + /* memrchr is a GNU specific extension + Emulate for wide compatability */ + for(p = e; *p != ':' && p >= s; p--); + + if (*p == ':') { if (!ret->port) { p++; if (e-p > 5) { /* port cannot be longer then 5 characters */ @@ -228,7 +232,7 @@ efree(ret); return NULL; } - + ret->host = estrndup(s, (p-s)); php_replace_controlchars(ret->host);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php