php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22805 Long input fields get truncated when posted (to about 1kb)
Submitted: 2003-03-20 07:34 UTC Modified: 2003-03-24 18:39 UTC
From: M dot Hankus at ce3 dot pl Assigned: ianh (profile)
Status: Closed Package: Apache2 related
PHP Version: 4.3.2RC1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: M dot Hankus at ce3 dot pl
New email:
PHP Version: OS:

 

 [2003-03-20 07:34 UTC] M dot Hankus at ce3 dot pl
When you try to create form with inputs, which values are very 
big lets say 30k. When you submit such form, script responsible  for accepting date will see only 1k of that data.

example script:

<?php

        $tekst="VERY LONG VARIABLE lets say 30k long";   

        if(isset($_POST["moj"])) echo " We have".strlen($_POST["moj"]);
        $tekst=htmlspecialchars($tekst);

        echo <<<KONIEC
<html>
<head>
</head>
<body>
<form method="post">
<input type="hidden" name="moj" value="$tekst">
<input type="submit">
</form>
</body>
</html>

KONIEC;


?>



You must only initialize variable $tekst with long string about 30k and observe results. 
In my case script shows:

apache 1.3.27 + php 4.3.1: 29100
apache 2.0.44 + php 4.3.2RC1: 1012  (same script and same php.ini)
apache 2.0.44 + php4-STABLE-200303201230: 1012

I know that bug like this was reported earlier but for different version of php.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-20 08:04 UTC] moriyoshi@php.net
See bug #18648. That seems due to the misconfigured httpd.conf.

 [2003-03-20 09:25 UTC] M dot Hankus at ce3 dot pl
According to bug #18648 my apache is configured correctly.

I also compiled php 4.3.1 with apache 2.0.44 and it works fine . Something is wrong only with 4.3.2RC1+ .


In 4.3.2RC adding

enctype="multipart/form-data"

to form solved the problem (like in bug #18648).
 [2003-03-20 17:20 UTC] sniper@php.net
You're sure you don't have that <files *.php> section??

 [2003-03-21 00:06 UTC] moriyoshi@php.net
This is a brand-new apache2handler bug.


 [2003-03-21 16:36 UTC] moriyoshi@php.net
Ian said he would take a look into this problem in this weekend..
 [2003-03-24 18:39 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 16:01:29 2024 UTC