A refactoring of the strip tags state machine[1] missed the special
treatment of `depth > 0` when a `>` is encountered in state 2 or 3. We
re-add it for BC reasons.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=
5cf64742773ddbf9af69d962a4d12b567fcf0084>
- Standard:
. Fixed bug #77931 (Warning for array_map mentions wrong type). (Nikita)
+ . Fixed bug #78003 (strip_tags output change since PHP 7.3). (cmb)
02 May 2019, PHP 7.3.5
}
break;
case '>':
+ if (depth) {
+ depth--;
+ break;
+ }
if (in_q) {
break;
}
c = *p;
switch (c) {
case '>':
+ if (depth) {
+ depth--;
+ break;
+ }
if (in_q) {
break;
}
--- /dev/null
+--TEST--
+Bug #78003 (strip_tags output change since PHP 7.3)
+--FILE--
+<?php
+var_dump(
+ strip_tags('<foo<>bar>'),
+ strip_tags('<foo<!>bar>'),
+ strip_tags('<foo<?>bar>')
+);
+?>
+===DONE===
+--EXPECT--
+string(0) ""
+string(0) ""
+string(0) ""
+===DONE===