php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30999 $_POST problem with <textarea></textarea> variables
Submitted: 2004-12-06 17:54 UTC Modified: 2004-12-15 01:00 UTC
Votes:6
Avg. Score:4.7 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:1 (20.0%)
From: kkoehler at comcast dot net Assigned:
Status: No Feedback Package: *URL Functions
PHP Version: 5.0.2 OS: Linux mis 2.4.21-4.EL #1-Red Hat
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kkoehler at comcast dot net
New email:
PHP Version: OS:

 

 [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.  

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-06 18:20 UTC] kkoehler at comcast dot net
Also, here is more information:

Apache/2.0.46 (Red Hat) 

core prefork http_core mod_so mod_access mod_auth mod_auth_anon mod_auth_dbm mod_auth_digest mod_include mod_log_config mod_env mod_mime_magic mod_cern_meta mod_expires mod_deflate mod_headers mod_usertrack mod_unique_id mod_setenvif mod_mime mod_dav mod_status mod_autoindex mod_asis mod_info mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_imap mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_proxy proxy_ftp proxy_http proxy_connect mod_cache mod_suexec mod_disk_cache mod_file_cache mod_mem_cache mod_cgi mod_auth_mysql mod_auth_pgsql mod_authz_ldap mod_perl sapi_apache2 mod_python mod_ssl 

./configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-pcre=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-mysql=shared,/usr' '--with-ldap' '--with-oci8=/opt/oracle/product/9.2.0' '--with-pgsql=shared' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2filter=/usr/sbin/apxs' '--enable-sigchild' '--enable-cli' '--enable-libgcc' '--with-java=/usr/local/j2sdk1.3.1' '--with-tsrm-pthreads' '--enable-embed'
 [2004-12-06 18:35 UTC] kkoehler at comcast dot net
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
)
 [2004-12-06 18:41 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try avoid embedding huge scripts into the report.


 [2004-12-06 18:43 UTC] jorton@php.net
Which SAPI interface, and what Apache configuration are you using?
 [2004-12-06 18:57 UTC] kkoehler at comcast dot net
Apache 2.0.46  
cryus-sasl-gssapi-2.1.15-3
 [2004-12-06 19:39 UTC] kkoehler at comcast dot net
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();

?>
 [2004-12-06 20:29 UTC] kkoehler at comcast dot net
We rolled back to 4.3.8 and it is doing it there also.  But I'm running 4.3.8 locally on Windows XP and it is not happening.  So it might be something with the OS???  This is a major issue so any help would be appreciated.
 [2004-12-06 23:53 UTC] jorton@php.net
Please answer the question:

> Which SAPI interface, and what Apache configuration are you using?

there's a known issue where you can misconfigure the apache2filter and it will break with symptoms like this: switching to the apache2handler is the best fix, or else remove the "SetOutputFilter" statements for PHP from the apache configuration.
 [2004-12-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 17:01:25 2024 UTC