From: crandym2003 at yahoo dot com Operating system: Windows/Unix PHP version: 4.3.10 PHP Bug Type: CGI related Bug description: Bug with CGI HTTP_POST_VARS
Description: ------------ When using the POST method in a form defined with enctype="multipart/form-data", a single defined hidden form element is lost between form named EditSeries when submit button posts form to submit_series.php. This only happens when text data entered into the TEXTAREA contains a special trademark character ™. I have seen this same bug before with other special characters. The form "submit_series.php" should get (4) form elements in the attached code which are: series_id, destination, series_desc, series_photo. Performing a dump_var $HTTP_SERVER_VAR at the beginnging of submit_series.php only shows (3) because the first form item "series_id" is somehow lost through CGI intrepretation. This doesn't happen unless data containing ™ is entered into the TEXTAREA box. The workaround is to place all hidden entities in the form after the TEXTAREA item or insert a extra hidden blank entity just above the series_id entity. This also does not happen if the enctype="multipart/form-data" is set to text entry only. In this case however, the form contains an input type=file so the multipart/form-data is necessary. Reproduce code: --------------- <form name=EditSeries action="submit_series.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="series_id" value="123"> <input type="hidden" name="destination" value="$HTTP_SERVER_VARS['HTTP_REFERER']"> <TD width="85%"><TEXTAREA class=FormAdmin name=series_desc rows=8 wrap=virtual cols=66><?php print $series_desc ?></TEXTAREA></TD> <TD width="85%"><input class=FormAdmin type="file" size="56" name="series_photo" value=""></TD> Expected result: ---------------- When you run dump_vars($HTTP_SERVER_VARS) on the submit_series.php form and print them, there should be a total of (4) form items passed which are which are: series_id, destination, series_desc, series_photo. Actual result: -------------- When you run dump_vars($HTTP_SERVER_VARS) on the submit_series.php form and print them, there area a total of (3) form items passed which are which are: destination, series_desc, series_photo. Somehow, the first defined hidden entity series_id is lost and not defined in $HTTP_SERVER_VARS. This only happens when a special trademark character is entered as text data in the TEXTAREA box. If you move the location of the hidden items somewhere in the form "after" the TEXTAREA item, all elements are forwarded to the next page (i.e., this is a workaround) -- Edit bug report at http://bugs.php.net/?id=32232&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32232&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32232&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32232&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32232&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32232&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32232&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32232&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32232&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32232&r=support Expected behavior: http://bugs.php.net/fix.php?id=32232&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32232&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32232&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32232&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32232&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32232&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32232&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32232&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32232&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32232&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32232&r=mysqlcfg