|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-05-11 12:27 UTC] alex at buayacorp dot com
Description: ------------ While doing the migration from PHP 7.2 to PHP 7.3, we noticed an output change of strip_tags which broke some text parsing related code in our application. Since the release notes from PHP 7.3 only mentions the deprecation of strip tags stream filtering [1], we are wondering if this output change was an intended or not. You can see the different output in https://3v4l.org/lE5Vb [1] https://php.net/manual/en/migration73.deprecated.php#migration73.deprecated.core.strip-tags-streaming Test script: --------------- <?php $s=<<<FOO <script>if (i<j.length);</script> hola<a href="foo">demo</a> <script> /* <![CDATA[ */ /* ]]> */ if(a>2); </script> demo bar FOO; var_dump(strip_tags( $s, '<a>' )); Expected result: ---------------- string(18) "if (i2); demo bar" Actual result: -------------- string(26) "if (i */ if(a2); demo bar" PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Simpler reproducer: <?php var_dump( strip_tags('<foo<>bar>'), strip_tags('<foo<!>bar>') ); ?> PHP 7.2 outputs: string(0) "" string(0) "" PHP 7.3 outputs: string(0) "" string(3) "bar" However, whether there's an exclamation mark or not shouldn't make a difference.