Skip to content

Commit f12dc90

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #78346: strip_tags no longer handling nested php tags
2 parents e60c507 + a87ef5e commit f12dc90

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ PHP NEWS
4040
- Standard:
4141
. Fixed bug #78326 (improper memory deallocation on stream_get_contents()
4242
with fixed length buffer). (Albert Casademont)
43+
. Fixed bug #78346 (strip_tags no longer handling nested php tags). (cmb)
4344

4445
25 Jul 2019, PHP 7.4.0beta1
4546

ext/standard/string.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5385,8 +5385,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, uint8_t *stateptr, const
53855385
} else if (lc != '\\') {
53865386
lc = c;
53875387
}
5388-
} else {
5389-
if (p != buf && *(p-1) != '\\' && (!in_q || *p == in_q)) {
5388+
if (p != buf && (!in_q || *p == in_q)) {
53905389
if (in_q) {
53915390
in_q = 0;
53925391
} else {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--TEST--
2+
Bug #78346 (strip_tags no longer handling nested php tags)
3+
--FILE--
4+
<?php
5+
$str = '<?= \'<?= 1 ?>\' ?>2';
6+
var_dump(strip_tags($str));
7+
?>
8+
--EXPECT--
9+
string(1) "2"

0 commit comments

Comments
 (0)