-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Was segfaulting if no allowed tags are specified and performing an out of bounds read if they were.
- Loading branch information
Showing
2 changed files
with
40 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--TEST-- | ||
string.strip_tags filter | ||
--FILE-- | ||
<?php | ||
$fp = fopen('php://output', 'w'); | ||
stream_filter_append($fp, 'string.strip_tags'); | ||
fwrite($fp, "test <b>bold</b> <i>italic</i> test\n"); | ||
fclose($fp); | ||
|
||
$fp = fopen('php://output', 'w'); | ||
stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, "<b>"); | ||
fwrite($fp, "test <b>bold</b> <i>italic</i> test\n"); | ||
fclose($fp); | ||
|
||
$fp = fopen('php://output', 'w'); | ||
stream_filter_append($fp, 'string.strip_tags', STREAM_FILTER_WRITE, ["b"]); | ||
fwrite($fp, "test <b>bold</b> <i>italic</i> test\n"); | ||
fclose($fp); | ||
|
||
?> | ||
--EXPECT-- | ||
test bold italic test | ||
test <b>bold</b> italic test | ||
test <b>bold</b> italic test |