Disabling the built-in POST handler

php.internals

Stefanos Stamatis

18 years ago
Trying to find a way to disable the built-in post form handler for the reasons discussed here: http://marc.info/?l=php-general&m=119160177617046&w=2 I looked at the code of php and found out that inside main/rfc1867.c in function rfc1867_post_handler there is a check whether the posted data content length exceeds the post_max_size parameter. If so it aborts the function (with a warning). (php-5.2.5, main/rfc1867.c, line 798) if (SG(request_info).content_length > SG(post_max_size)) { sapi_module.sapi_error(E_WARNING, "POST Content-Length of %ld bytes exceeds the limit of %ld bytes", SG(request_info).content_leng th, SG(post_max_size)); return; } So setting post_max_size to zero for the script with php_value in the apache configuration disables the built-in post form handler resulting in the desired behaviour! My question is whether this is the expected behavior of php that we can count on and can be used as a solution to our problem. Thanks in advance, Stefanos Stamatis.

Hannes Magnusson

18 years ago
On Nov 21, 2007 6:30 PM, Stefanos Stamatis <stef@noc.uoa.gr> wrote:
> So setting post_max_size to zero for the script with php_value in the > apache configuration disables the built-in post form handler resulting in > the desired behaviour! > > My question is whether this is the expected behavior of php that we can > count on and can be used as a solution to our problem.
Yes. http://www.php.net/manual/en/ini.core.php#ini.post-max-size -Hannes

Richard Quadling

18 years ago
On 21/11/2007, Hannes Magnusson <hannes.magnusson@gmail.com> wrote:
> On Nov 21, 2007 6:30 PM, Stefanos Stamatis <stef@noc.uoa.gr> wrote: > > So setting post_max_size to zero for the script with php_value in the > > apache configuration disables the built-in post form handler resulting in > > the desired behaviour! > > > > My question is whether this is the expected behavior of php that we can > > count on and can be used as a solution to our problem. > > Yes. http://www.php.net/manual/en/ini.core.php#ini.post-max-size > > -Hannes
Would it be worth stating specifically that a post-max-size of zero inhibits $_POST/$_FILES?
-- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"