|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-28 00:44 UTC] support at jevon dot org
[2004-12-28 04:37 UTC] steven at acko dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 01:00:01 2025 UTC |
Description: ------------ The strip_tags function is hardcoded to strip out <!...> tags, such as comments. It is IMO expected behaviour for the function that specifying "<!-->" or "<!DOCTYPE>" in the allowed tags list leaves these intact. If this is expected behaviour for this function, then the documentation should be updated. (PS: The state machine in php_strip_tags() in string.c seems to contain some redundancies. Someone who understand all of it should take a closer look ;)) Reproduce code: --------------- <?php print strip_tags("Some text. <!-- a comment --> Some text.", "<!-->"); ?> Expected result: ---------------- The output should be: Some text. <!-- a comment --> Some text. (with the comment intact) Actual result: -------------- The output is: Some text. Some text. (the comment is stripped out)