svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/main/SAPI.c branches/PHP_5_3/tests/basic/bug53180.phpt trunk/main/SAPI.c
trunk/tests/basic/bug53180.phpt
| From: | Gustavo André dos Santos Lopes | Date: | Wed, 27 Oct 2010 14:56:51 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/main/SAPI.c branches/PHP_5_3/tests/basic/bug53180.phpt trunk/main/SAPI.c trunk/tests/basic/bug53180.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-63725@lists.php.net to get a copy of this message | ||
cataphract Wed, 27 Oct 2010 14:56:51 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=304958
Log:
- Fixed bug #53180 (post_max_size=0 not disabling the limit when the content
type is application/x-www-form-urlencoded or is not registered with PHP).
Bug: http://bugs.php.net/53180 (Assigned) post_max_size=0
partly not working
Changed paths:
U php/php-src/branches/PHP_5_3/NEWS
U php/php-src/branches/PHP_5_3/main/SAPI.c
A php/php-src/branches/PHP_5_3/tests/basic/bug53180.phpt
U php/php-src/trunk/main/SAPI.c
A php/php-src/trunk/tests/basic/bug53180.phpt
Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS 2010-10-27 13:47:27 UTC (rev 304957)
+++ php/php-src/branches/PHP_5_3/NEWS 2010-10-27 14:56:51 UTC (rev 304958)
@@ -44,6 +44,9 @@
- Fixed ReflectionProperty::isDefault() giving a wrong result for properties
obtained with ReflectionClass::getProperties(). (Gustavo)
+- Fixed bug #53180 (post_max_size=0 not disabling the limit when the content
+ type is application/x-www-form-urlencoded or is not registered with PHP).
+ (gm at tlink dot de, Gustavo)
- Fixed bug #53144 (Segfault in SplObjectStorage::removeAll()). (Felipe)
- Fixed bug #53071 (SPLObjectStorage defeats gc_collect_cycles). (Gustavo)
- Fixed bug #53006 (stream_get_contents has an unpredictable behavior when the
Modified: php/php-src/branches/PHP_5_3/main/SAPI.c
===================================================================
--- php/php-src/branches/PHP_5_3/main/SAPI.c 2010-10-27 13:47:27 UTC (rev 304957)
+++ php/php-src/branches/PHP_5_3/main/SAPI.c 2010-10-27 14:56:51 UTC (rev 304958)
@@ -194,7 +194,7 @@
int read_bytes;
int allocated_bytes=SAPI_POST_BLOCK_SIZE+1;
- if (SG(request_info).content_length > SG(post_max_size)) {
+ if ((SG(post_max_size) > 0) && (SG(request_info).content_length >
SG(post_max_size))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the
limit of %ld bytes",
SG(request_info).content_length, SG(post_max_size));
return;
@@ -207,7 +207,7 @@
break;
}
SG(read_post_bytes) += read_bytes;
- if (SG(read_post_bytes) > SG(post_max_size)) {
+ if ((SG(post_max_size) > 0) && (SG(read_post_bytes) > SG(post_max_size))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match
Content-Length, and exceeds %ld bytes", SG(post_max_size));
break;
}
Added: php/php-src/branches/PHP_5_3/tests/basic/bug53180.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/tests/basic/bug53180.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/tests/basic/bug53180.phpt 2010-10-27 14:56:51 UTC (rev 304958)
@@ -0,0 +1,19 @@
+--TEST--
+Bug #53180 (post_max_size=0 partly not working)
+--INI--
+post_max_size=0
+--POST--
+email=foo&password=bar&submit=Log+on
+--FILE--
+<?php
+var_dump($_POST);
+?>
+--EXPECT--
+array(3) {
+ ["email"]=>
+ string(3) "foo"
+ ["password"]=>
+ string(3) "bar"
+ ["submit"]=>
+ string(6) "Log on"
+}
Modified: php/php-src/trunk/main/SAPI.c
===================================================================
--- php/php-src/trunk/main/SAPI.c 2010-10-27 13:47:27 UTC (rev 304957)
+++ php/php-src/trunk/main/SAPI.c 2010-10-27 14:56:51 UTC (rev 304958)
@@ -194,7 +194,7 @@
int read_bytes;
int allocated_bytes=SAPI_POST_BLOCK_SIZE+1;
- if (SG(request_info).content_length > SG(post_max_size)) {
+ if ((SG(post_max_size) > 0) && (SG(request_info).content_length >
SG(post_max_size))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "POST Content-Length of %ld bytes exceeds the
limit of %ld bytes",
SG(request_info).content_length, SG(post_max_size));
return;
@@ -207,7 +207,7 @@
break;
}
SG(read_post_bytes) += read_bytes;
- if (SG(read_post_bytes) > SG(post_max_size)) {
+ if ((SG(post_max_size) > 0) && (SG(read_post_bytes) > SG(post_max_size))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Actual POST length does not match
Content-Length, and exceeds %ld bytes", SG(post_max_size));
break;
}
Added: php/php-src/trunk/tests/basic/bug53180.phpt
===================================================================
--- php/php-src/trunk/tests/basic/bug53180.phpt (rev 0)
+++ php/php-src/trunk/tests/basic/bug53180.phpt 2010-10-27 14:56:51 UTC (rev 304958)
@@ -0,0 +1,19 @@
+--TEST--
+Bug #53180 (post_max_size=0 partly not working)
+--INI--
+post_max_size=0
+--POST--
+email=foo&password=bar&submit=Log+on
+--FILE--
+<?php
+var_dump($_POST);
+?>
+--EXPECT--
+array(3) {
+ ["email"]=>
+ string(3) "foo"
+ ["password"]=>
+ string(3) "bar"
+ ["submit"]=>
+ string(6) "Log on"
+}