iliaa           Mon Apr 25 19:48:33 2005 EDT

  Modified files:              (Branch: PHP_5_0)
    /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.7.2.1&r2=1.7.2.2&ty=u
Index: php-src/ext/standard/tests/strings/url_t.phpt
diff -u php-src/ext/standard/tests/strings/url_t.phpt:1.7.2.1 
php-src/ext/standard/tests/strings/url_t.phpt:1.7.2.2
--- php-src/ext/standard/tests/strings/url_t.phpt:1.7.2.1       Thu Jan 27 
11:38:05 2005
+++ php-src/ext/standard/tests/strings/url_t.phpt       Mon Apr 25 19:48:30 2005
@@ -67,7 +67,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) {
@@ -657,3 +658,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.81.2.2&r2=1.81.2.3&ty=u
Index: php-src/ext/standard/url.c
diff -u php-src/ext/standard/url.c:1.81.2.2 php-src/ext/standard/url.c:1.81.2.3
--- php-src/ext/standard/url.c:1.81.2.2 Thu Jan 27 11:38:05 2005
+++ php-src/ext/standard/url.c  Mon Apr 25 19:48:30 2005
@@ -15,7 +15,7 @@
    | Author: Jim Winstead <[EMAIL PROTECTED]>                                  
|
    +----------------------------------------------------------------------+
  */
-/* $Id: url.c,v 1.81.2.2 2005/01/27 16:38:05 iliaa Exp $ */
+/* $Id: url.c,v 1.81.2.3 2005/04/25 23:48:30 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.
@@ -303,7 +309,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.1760.2.347&r2=1.1760.2.348&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.347 php-src/NEWS:1.1760.2.348
--- php-src/NEWS:1.1760.2.347   Mon Apr 25 17:19:05 2005
+++ php-src/NEWS        Mon Apr 25 19:48:31 2005
@@ -7,6 +7,7 @@
 - Changed sha1_file() and md5_file() functions to use streams instead of
   low level IO. (Uwe)
 - Fixed memory corruption in ImageTTFText() with 64bit systems. (Andrey)
+- Fixed bug #32813 (parse_url() does not handle scheme-only urls properly). 
(Ilia)
 - Fixed bug #32809 (Missing T1LIB support on Windows). (Edin)
 - Fixed bug #32802 (General cookie overrides more specific cookie). (Ilia)
 - Fixed bug #32776 (SOAP doesn't support one-way operations). (Dmitry)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to