|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2004-12-06 17:54 UTC] kkoehler at comcast dot net
 Description:
------------
I'm using Smarty 2.6.5 also.  When I have a $_POST coming in that is over 1300 bytes, it reads in the full data but takes a chunk at the bottom and duplicates it.  So if you have over 1300 bytes, it reads in the 1300 bytes and then takes part of the last so many bytes and keeps duplicating it with every submit.
I verified that the $_POST data has the duplicated data but the screen before submit does not.  This same code works in 4.3.8 without any problem. 
Reproduce code:
---------------
Here's the smarty code:
<textarea name="cldescription" cols="94" rows="17" >{$dformVars.cldescription}</textarea>
Piece of the PHP code:
$description = trim($_POST['cldescription']);
	echo "SIZE " . strlen($description);
Expected result:
----------------
What I see on the screen is what comes in via the $_POST.
Actual result:
--------------
As I keep reexecuting the code via submit, the size keeps growing.  
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 01:00:01 2025 UTC | 
More testing - when I run this script on 5.0.2 <html> <form method="post" action="<?= $_SERVER['PHP_SELF']; ?>"> <textarea name="ta"></textarea> <input type="submit" value="try this"/> </form> <pre><?php print_r( $_POST ); ?></pre> </html> If I enter "Hello", this displays: Array ( [ta] => Hellota=Hello ) On 4.3.8 it displays: Array ( [ta] => Hello )Here is test code using smarty. You'll probably have to change the configs a bit: Template: <html> <body> <form name="articulate" method=POST action="testa.php"> <a href="javascript:document.articulate.submit()" class="listlink2"><img src="/images/save.gif" border="0"></a> <table> <td class="warning" align="left"> <textarea name="testdesc" cols="94" rows="17" >{$testdesc}</textarea> </td> </tr> </table> </td> </table> </center> </form> </body> </html> PHP code: <?php ob_start(); define('SMARTY_DIR', 'C:\Program Files\Apache Group\Apache2\htdocs\Smarty-2.6.6/libs/'); require(SMARTY_DIR . 'Smarty.class.php'); function getSmarty() { $smarty = new Smarty; $smarty->template_dir = 'templates/'; $smarty->compile_dir = 'templates_c/'; $smarty->config_dir = 'configs/'; $smarty->cache_dir = 'cache/'; return $smarty; } session_start(); $smarty = getSmarty(); print_r($_POST); $test = $_POST['testdesc']; $smarty->assign('testdesc', $test); $smarty->display('testa.tpl'); ob_end_flush(); ?>