iliaa Mon Apr 25 19:49:29 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/standard/tests/strings url_t.phpt /php-src/ext/standard url.c /php-src NEWS Log: MFH: Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). http://cvs.php.net/diff.php/php-src/ext/standard/tests/strings/url_t.phpt?r1=1.3.2.6&r2=1.3.2.7&ty=u Index: php-src/ext/standard/tests/strings/url_t.phpt diff -u php-src/ext/standard/tests/strings/url_t.phpt:1.3.2.6 php-src/ext/standard/tests/strings/url_t.phpt:1.3.2.7 --- php-src/ext/standard/tests/strings/url_t.phpt:1.3.2.6 Thu Jan 27 11:38:30 2005 +++ php-src/ext/standard/tests/strings/url_t.phpt Mon Apr 25 19:49:27 2005 @@ -69,7 +69,8 @@ 'file://path/to/file', 'file:/path/to/file', 'http://1.2.3.4:/abc.asp?a=1&b=2', -'http://foo.com#bar' +'http://foo.com#bar', +'scheme:' ); foreach ($sample_urls as $url) { @@ -659,3 +660,7 @@ ["fragment"]=> string(3) "bar" } +array(1) { + ["scheme"]=> + string(6) "scheme" +} http://cvs.php.net/diff.php/php-src/ext/standard/url.c?r1=1.58.2.19&r2=1.58.2.20&ty=u Index: php-src/ext/standard/url.c diff -u php-src/ext/standard/url.c:1.58.2.19 php-src/ext/standard/url.c:1.58.2.20 --- php-src/ext/standard/url.c:1.58.2.19 Thu Jan 27 11:38:30 2005 +++ php-src/ext/standard/url.c Mon Apr 25 19:49:27 2005 @@ -15,7 +15,7 @@ | Author: Jim Winstead <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: url.c,v 1.58.2.19 2005/01/27 16:38:30 iliaa Exp $ */ +/* $Id: url.c,v 1.58.2.20 2005/04/25 23:49:27 iliaa Exp $ */ #include <stdlib.h> #include <string.h> @@ -104,6 +104,12 @@ /* parse scheme */ if ((e = memchr(s, ':', length)) && (e - s)) { + if (*(e + 1) == '\0') { /* only scheme is available */ + ret->scheme = estrndup(s, (e - s)); + php_replace_controlchars_ex(ret->scheme, (e - s)); + goto end; + } + /* * certain schemas like mailto: and zlib: may not have any / after them * this check ensures we support those. @@ -297,7 +303,7 @@ ret->path = estrndup(s, (ue-s)); php_replace_controlchars_ex(ret->path, (ue - s)); } - +end: return ret; } /* }}} */ http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.889&r2=1.1247.2.890&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.889 php-src/NEWS:1.1247.2.890 --- php-src/NEWS:1.1247.2.889 Mon Apr 25 17:22:47 2005 +++ php-src/NEWS Mon Apr 25 19:49:27 2005 @@ -6,6 +6,7 @@ them sort based on the current locale. (Derick) - Changed sha1_file() and md5_file() functions to use streams instead of low level IO. (Uwe) +- Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). (Ilia) - Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia) - Fixed bug #32730 (ext/crack.c fails to compile with cracklib-2.8.3). (Jani) - Fixed bug #32699 (pg_affected_rows() was defined when it was not available).
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php