When the strip tags state machine has been flattened, an if statement
has mistakenly been treated as else if. We fix this, and also simplify
a bit right away.
with invalid length). (Nikita)
. Fixed bug #78326 (improper memory deallocation on stream_get_contents()
with fixed length buffer). (Albert Casademont)
+ . Fixed bug #78346 (strip_tags no longer handling nested php tags). (cmb)
01 Aug 2019, PHP 7.3.8
} else if (lc != '\\') {
lc = c;
}
- } else {
- if (p != buf && *(p-1) != '\\' && (!in_q || *p == in_q)) {
+ if (p != buf && (!in_q || *p == in_q)) {
if (in_q) {
in_q = 0;
} else {
--- /dev/null
+--TEST--
+Bug #78346 (strip_tags no longer handling nested php tags)
+--FILE--
+<?php
+$str = '<?= \'<?= 1 ?>\' ?>2';
+var_dump(strip_tags($str));
+?>
+--EXPECT--
+string(1) "2"