iliaa           Thu Sep 28 15:16:41 2006 UTC

  Modified files:              (Branch: PHP_4_4)
    /php-src/ext/standard       url.c 
    /php-src/ext/standard/tests/strings url_t.phpt 
    /php-src    NEWS 
  Log:
  MFH: Fixed bug #38859 (parse_url() fails if passing '@' in passwd).
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/url.c?r1=1.58.2.21.2.3&r2=1.58.2.21.2.4&diff_format=u
Index: php-src/ext/standard/url.c
diff -u php-src/ext/standard/url.c:1.58.2.21.2.3 
php-src/ext/standard/url.c:1.58.2.21.2.4
--- php-src/ext/standard/url.c:1.58.2.21.2.3    Sun Feb 12 16:43:03 2006
+++ php-src/ext/standard/url.c  Thu Sep 28 15:16:40 2006
@@ -15,7 +15,7 @@
    | Author: Jim Winstead <[EMAIL PROTECTED]>                                  
|
    +----------------------------------------------------------------------+
  */
-/* $Id: url.c,v 1.58.2.21.2.3 2006/02/12 16:43:03 iliaa Exp $ */
+/* $Id: url.c,v 1.58.2.21.2.4 2006/09/28 15:16:40 iliaa Exp $ */
 
 #include <stdlib.h>
 #include <string.h>
@@ -202,9 +202,17 @@
        } else {
                e = p;
        }       
+
+       {
+               char *t = s;
+               p = NULL;
+               while (e > t && (t = memchr(t, '@', (e-t)))) {
+                       p = t++;
+               }
+       }
                
        /* check for login and password */
-       if ((p = memchr(s, '@', (e-s)))) {
+       if (p) {
                if ((pp = memchr(s, ':', (p-s)))) {
                        if ((pp-s) > 0) {
                                ret->user = estrndup(s, (pp-s));
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/url_t.phpt?r1=1.3.2.7.2.1&r2=1.3.2.7.2.2&diff_format=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.7.2.1 
php-src/ext/standard/tests/strings/url_t.phpt:1.3.2.7.2.2
--- php-src/ext/standard/tests/strings/url_t.phpt:1.3.2.7.2.1   Tue Aug 16 
14:12:13 2005
+++ php-src/ext/standard/tests/strings/url_t.phpt       Thu Sep 28 15:16:40 2006
@@ -72,6 +72,7 @@
 'http://foo.com#bar',
 'scheme:',
 'foo+bar://[EMAIL PROTECTED]/bla',
+'http://user:@[EMAIL PROTECTED]/path?argument?value#etc',
 );
 
     foreach ($sample_urls as $url) {
@@ -521,11 +522,11 @@
   ["scheme"]=>
   string(4) "http"
   ["host"]=>
-  string(19) "[EMAIL PROTECTED]"
+  string(11) "www.php.net"
   ["port"]=>
   int(80)
   ["user"]=>
-  string(6) "secret"
+  string(14) "[EMAIL PROTECTED]"
   ["path"]=>
   string(10) "/index.php"
   ["query"]=>
@@ -675,3 +676,19 @@
   ["path"]=>
   string(4) "/bla"
 }
+array(7) {
+  ["scheme"]=>
+  string(4) "http"
+  ["host"]=>
+  string(4) "host"
+  ["user"]=>
+  string(4) "user"
+  ["pass"]=>
+  string(5) "@pass"
+  ["path"]=>
+  string(5) "/path"
+  ["query"]=>
+  string(14) "argument?value"
+  ["fragment"]=>
+  string(3) "etc"
+}
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.1247.2.920.2.164&r2=1.1247.2.920.2.165&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.164 php-src/NEWS:1.1247.2.920.2.165
--- php-src/NEWS:1.1247.2.920.2.164     Wed Sep 27 23:45:36 2006
+++ php-src/NEWS        Thu Sep 28 15:16:40 2006
@@ -3,6 +3,7 @@
 ?? ??? 2006, Version 4.4.5
 - Updated PCRE to version 6.7. (Ilia)
 - Fixed bug #38963 (Fixed a possible open_basedir bypass in tempnam()). (Ilia)
+- Fixed bug #38859 (parse_url() fails if passing '@' in passwd). (Tony,Ilia)
 - Fixed bug #38534 (segfault when calling setlocale() in userspace session
   handler). (Tony)
 - Fixed bug #38450 (constructor is not called for classes used in userspace

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

Reply via email to