|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-06 12:17 UTC] derick@php.net
[2006-04-06 12:50 UTC] msaladna at apisnetworks dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 01:00:01 2025 UTC |
Description: ------------ This actually happens with PHP 5.1.2 and the filter extension built into PHP's interpreter directly. On a post, all data that is enclosed by <>, e.g. HTML tags, even the PHP delimiters <?php ... ?> are removed from the variable. Thus "<foo>" becomes "", "<?php ... some code ... ?>" becomes "", "<foo>bar</foo>" becomes "bar", and so on. I have a workaround temporarily to remedy the problem. Add an onSubmit event to the form tag and change all occurrences of < in the field to &lt; which appears to fix it. Hopefully this should be independent of the PHP build options and php.ini settings. If not, let me know and I can include that information as well. Reproduce code: --------------- <?php if (isset($_POST['code'])) { var_export($_POST); } ?> <form method="post"> <textarea rows="40" cols="80" name="code" WRAP="OFF"></textarea> <br /> <input type="submit" /> </form> Enter something like, "<test>foo</test>" into the textarea Expected result: ---------------- <test>foo</test> Actual result: -------------- foo