|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-10-25 23:06 UTC] kjackson at gpu dot srv dot ualberta dot ca
This bug causes strip_tags to stop stripping php tags, if your string contains the following in a <?php?> delimiter.
"title = \"([^\"]+)\""
Example:
echo strip_tags("
aghh1
<?PHP
if (eregi(\"title = \\\"([^\\\"]+)\", $x, $y))
echo \"foobar\";
?>
aghh2
");
will result in only aghh1 being reported when aghh2 should clearly be as well
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 19:00:01 2025 UTC |
it is the unbalanced quotes that causes this. smaller example: <?php echo strip_tags("first <?echo \"\\\"\"?> second"); ?> refiling against 4.0, although it would be nice if any fix were backported. (or the behavior could be documented.)Bug still exists in PHP 4.1.1, tested under Linux 2.4 and Windows XP with: echo strip_tags("first <?echo \"\\\"\"?> second");looked at php_strip_tags, The state machine is tracking "'s, )'s and ('s. I don't know if this is necessary. Can fix by simply removing that code. Emailed dev list asking for any further info.$result_strip_tags = strip_tags("first <?echo \"\\\"\"?> second"); echo "\n$result_strip_tags\n"; still results in sebastian@linux:~> /usr/local/bin/php strip_tags.php first sebastian@linux:~>