iliaa Sun May 6 16:34:15 2007 UTC Modified files: (Branch: PHP_5_2) /php-src NEWS /php-src/main php_content_types.c Log: Fixed bug #41293 (Fixed creation of HTTP_RAW_POST_DATA when there is no default post handler). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.684&r2=1.2027.2.547.2.685&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.684 php-src/NEWS:1.2027.2.547.2.685 --- php-src/NEWS:1.2027.2.547.2.684 Sun May 6 15:37:07 2007 +++ php-src/NEWS Sun May 6 16:34:14 2007 @@ -5,6 +5,8 @@ (Ilia) - Fixed altering $this via argument named "this". (Dmitry) - Fixed PHP CLI to use the php.ini from the binary location. (Hannes) +- Fixed bug #41293 (Fixed creation of HTTP_RAW_POST_DATA when there is no + default post handler). (Ilia) - Fixed bug #41287 (Namespace functions don't allow xmlns defintion to be optional). (Rob) - Fixed bug #41285 (Improved fix for CVE-2007-1887 to work with non-bundled http://cvs.php.net/viewvc.cgi/php-src/main/php_content_types.c?r1=1.32.2.1.2.2&r2=1.32.2.1.2.3&diff_format=u Index: php-src/main/php_content_types.c diff -u php-src/main/php_content_types.c:1.32.2.1.2.2 php-src/main/php_content_types.c:1.32.2.1.2.3 --- php-src/main/php_content_types.c:1.32.2.1.2.2 Sun Apr 1 19:09:36 2007 +++ php-src/main/php_content_types.c Sun May 6 16:34:14 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_content_types.c,v 1.32.2.1.2.2 2007/04/01 19:09:36 iliaa Exp $ */ +/* $Id: php_content_types.c,v 1.32.2.1.2.3 2007/05/06 16:34:14 iliaa Exp $ */ #include "php.h" #include "SAPI.h" @@ -37,21 +37,19 @@ */ SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader) { - char *data = NULL; - int length = 0; + char *data; + int length; /* $HTTP_RAW_POST_DATA registration */ - if(!strcmp(SG(request_info).request_method, "POST")) { - if(NULL == SG(request_info).post_entry && SG(request_info).post_data) { + if (!strcmp(SG(request_info).request_method, "POST")) { + if (NULL == SG(request_info).post_entry) { /* no post handler registered, so we just swallow the data */ sapi_read_standard_form_data(TSRMLS_C); + } + + if (PG(always_populate_raw_post_data) && SG(request_info).post_data) { length = SG(request_info).post_data_length; data = estrndup(SG(request_info).post_data, length); - } else if(PG(always_populate_raw_post_data) && SG(request_info).post_data) { - length = SG(request_info).post_data_length; - data = estrndup(SG(request_info).post_data, length); - } - if(data) { SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, length); } } @@ -62,11 +60,10 @@ in the long run post handlers should be changed to not touch request_info.post_data for memory preservation reasons */ - if(SG(request_info).post_data) { + if (SG(request_info).post_data) { SG(request_info).raw_post_data = estrndup(SG(request_info).post_data, SG(request_info).post_data_length); SG(request_info).raw_post_data_length = SG(request_info).post_data_length; } - } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php