Fix #78003: strip_tags output change since PHP 7.3#4153
Fix #78003: strip_tags output change since PHP 7.3#4153cmb69 wants to merge 2 commits intophp:PHP-7.3from
Conversation
A refactoring of the strip tags state machine[1] missed the special treatment of `depth > 0` when a `>` is encountered in state 3. We re-add it for BC reasons. [1] <http://git.php.net/?p=php-src.git;a=commit;h=5cf64742773ddbf9af69d962a4d12b567fcf0084>
|
While for the given test case the old (i.e PHP-7.2 and PHP-7.3 with this patch) behavior is clearly more correct, for some other case the new (i.e. PHP-7.3 without this patch) behavior seems somewhat more reasonable. However, neither is actually optimal. Part of the problem is that we're still assuming that scripts are embedded inside of HTML/XML comments or CDATA sections, which may have been a reasonable assumption many years ago, but certainly isn't anymore. E.g. for |
|
Do we need this in state_2 as well maybe? |
|
Applied as 69bab6e. Thanks! |
A refactoring of the strip tags state machine[1] missed the special
treatment of
depth > 0when a>is encountered in state 3. Were-add it for BC reasons.
[1] http://git.php.net/?p=php-src.git;a=commit;h=5cf64742773ddbf9af69d962a4d12b567fcf0084