From:
Operating system: FreeBSD 8.1-RELEASE
PHP version: 5.3.3
Package: PHP options/info functions
Bug Type: Bug
Bug description:post_max_size=0 partly not working
Description:
------------
Setting php.ini option post_max_size=0 (for unlimited POSTs since 5.3.2)
isn't honoured in some cases. Doing a POST-form upload via curl or browser
with a 5GB file works as expected (by setting upload_max_filesize=0 too)
but using a login form (see below) results in this error:
PHP Warning: Unknown: POST Content-Length of 38 bytes exceeds the limit of
0 bytes in Unknown on line 0
It seems that main/SAPI.c lacks checks in SAPI_POST_READER_FUNC() for
ignoring size checking in case post_max_size==0. This check was implemented
in main/rfc1867.c only.
from: if (SG(request_info).content_length > S (post_max_size))
to: if (SG(post_max_size) > 0 && SG(request_info).content_length > S
(post_max_size))
and
from: if (SG(read_post_bytes) > SG(post_max_size))
to: if (SG(post_max_size) > 0 && SG(read_post_bytes) > SG(post_max_size))
Sorry for not attaching a diff yet.
Gregor
Test script:
---------------
Loginform:
<html><body>
<form enctype="application/x-www-form-urlencoded" accept-charset="UTF-8"
action="/login.php" method="post">
<input type="text" name="email" value="foo" />
<input type="password" name="password" value="bar" />
<input type="submit" name="submit" value="Log on" />
</form>
</body></html>
pointing to this login.php:
<?php
echo "Loginname: ".$_POST['email'] .'<br>';
echo "Password: ".$_POST['password'];
?>
Expected result:
----------------
Loginname: foo
Password: bar
Actual result:
--------------
Loginname:
Password:
--
Edit bug report at http://bugs.php.net/bug.php?id=53180&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53180&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53180&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53180&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53180&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53180&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53180&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53180&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53180&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53180&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53180&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53180&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53180&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53180&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53180&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53180&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53180&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53180&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53180&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53180&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53180&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53180&r=mysqlcfg