Skip to content

Commit e195b10

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #20664.
1 parent 28c10e2 commit e195b10

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ext/standard/string.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3496,6 +3496,8 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int *stateptr, char *allow, int
34963496
/* JavaScript & Other HTML scripting languages */
34973497
if (state == 1 && *(p-1) == '<') {
34983498
state = 3;
3499+
} else {
3500+
*(rp++) = c;
34993501
}
35003502
break;
35013503

ext/standard/tests/strings/strip_tags.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ strip_tags() function
1616
echo "\n";
1717
echo strip_tags('NEAT <? echo \'\\\'\'?> STUFF');
1818
echo "\n";
19+
echo strip_tags('TESTS ?!!?!?!!!?!!');
20+
echo "\n";
1921
?>
2022
--EXPECT--
2123
NEAT STUFF
@@ -24,3 +26,4 @@ NEAT STUFF
2426
NEAT STUFF
2527
NEAT STUFF
2628
NEAT STUFF
29+
TESTS ?!!?!?!!!?!!

0 commit comments

Comments
 (0)