-
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.
Fix bug #76249 - fail on invalid sequences
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 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,16 @@ | ||
--TEST-- | ||
Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequence) | ||
--SKIPIF-- | ||
<?php extension_loaded('iconv') or die('skip iconv extension is not available'); ?> | ||
--FILE-- | ||
<?php | ||
$fh = fopen('php://memory', 'rw'); | ||
fwrite($fh, "abc"); | ||
rewind($fh); | ||
stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, []); | ||
echo stream_get_contents($fh); | ||
?> | ||
DONE | ||
--EXPECTF-- | ||
Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d | ||
慢DONE |