pajoye                                   Thu, 04 Feb 2010 09:17:20 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=294506

Log:
- Fixed bug #50832 (HTTP fopen wrapper does not support passwordless HTTP

Bug: http://bugs.php.net/50832 (unknown) 
      
Changed paths:
    _U  php/php-src/branches/PHP_5_3_2/
    U   php/php-src/branches/PHP_5_3_2/ext/standard/http_fopen_wrapper.c
    _U  php/php-src/branches/PHP_5_3_2/ext/tidy/tests/
    _U  
php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt


Property changes on: php/php-src/branches/PHP_5_3_2
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292716,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293176,293180,293216,293235,293253,293268,293341,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293974,293985,294040
/php/php-src/trunk:284726
   + 
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292716,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293131,293144,293146,293152,293176,293180,293216,293235,293253,293268,293341,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293974,293985,293998,294040
/php/php-src/trunk:284726

Modified: php/php-src/branches/PHP_5_3_2/ext/standard/http_fopen_wrapper.c
===================================================================
--- php/php-src/branches/PHP_5_3_2/ext/standard/http_fopen_wrapper.c    
2010-02-04 09:13:14 UTC (rev 294505)
+++ php/php-src/branches/PHP_5_3_2/ext/standard/http_fopen_wrapper.c    
2010-02-04 09:17:20 UTC (rev 294506)
@@ -416,16 +416,20 @@
        }

        /* auth header if it was specified */
-       if (((have_header & HTTP_HEADER_AUTH) == 0) && resource->user && 
resource->pass)        {
+       if (((have_header & HTTP_HEADER_AUTH) == 0) && resource->user) {
                /* decode the strings first */
                php_url_decode(resource->user, strlen(resource->user));
-               php_url_decode(resource->pass, strlen(resource->pass));

                /* scratch is large enough, since it was made large enough for 
the whole URL */
                strcpy(scratch, resource->user);
                strcat(scratch, ":");
-               strcat(scratch, resource->pass);

+               /* Note: password is optional! */
+               if (resource->pass) {
+                       php_url_decode(resource->pass, strlen(resource->pass));
+                       strcat(scratch, resource->pass);
+               }
+
                tmp = (char*)php_base64_encode((unsigned char*)scratch, 
strlen(scratch), NULL);

                if (snprintf(scratch, scratch_len, "Authorization: Basic 
%s\r\n", tmp) > 0) {
@@ -746,7 +750,7 @@
                        s++;    \
                }       \
        }       \
-}      \
+}
                        /* check for control characters in login, password & 
path */
                        if (strncasecmp(new_path, "http://";, sizeof("http://";) 
- 1) || strncasecmp(new_path, "https://";, sizeof("https://";) - 1)) {
                                CHECK_FOR_CNTRL_CHARS(resource->user)


Property changes on: php/php-src/branches/PHP_5_3_2/ext/tidy/tests
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292716,292719,292765,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293985,294040
/php/php-src/trunk/ext/tidy/tests:284726,287798-287941
   + 
/php/php-src/branches/PHP_5_3/ext/tidy/tests:292562,292566,292571,292574,292635,292716,292719,292765,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293985,293998,294040
/php/php-src/trunk/ext/tidy/tests:284726,287798-287941


Property changes on: 
php/php-src/branches/PHP_5_3_2/tests/security/open_basedir_parse_ini_file.phpt
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,292716,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293985,294040
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951
   + 
/php/php-src/branches/PHP_5_3/tests/security/open_basedir_parse_ini_file.phpt:292562,292566,292571,292574,292716,293146,293152,293176,293180,293216,293235,293253,293380,293400,293442,293447,293466,293487,293502,293538,293548,293558,293588,293590,293597,293627,293644,293653,293655,293699,293726-293728,293732,293762,293768,293804,293862,293897,293901-293902,293906,293965,293985,293998,294040
/php/php-src/trunk/tests/security/open_basedir_parse_ini_file.phpt:265951

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

Reply via email to