diff options
author | Anatol Belski <ab@php.net> | 2018-04-24 10:47:32 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2018-04-24 10:47:32 +0200 |
commit | 4371af3e19820d2f8792a2c756ee850f544bd2a9 (patch) | |
tree | 45b24d03ec68299eec4517b45904f5c3f890a835 /ext/iconv | |
parent | ee76a5ae5ad57bb9d0bc183bcbf9c4652331c2e3 (diff) | |
download | php-git-4371af3e19820d2f8792a2c756ee850f544bd2a9.tar.gz |
Fix test portability
Diffstat (limited to 'ext/iconv')
-rw-r--r-- | ext/iconv/tests/bug76249.phpt | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/iconv/tests/bug76249.phpt b/ext/iconv/tests/bug76249.phpt index 1503f0bc81..0a2dcaed2f 100644 --- a/ext/iconv/tests/bug76249.phpt +++ b/ext/iconv/tests/bug76249.phpt @@ -7,12 +7,14 @@ Bug #76249 (stream filter convert.iconv leads to infinite loop on invalid sequen $fh = fopen('php://memory', 'rw'); fwrite($fh, "abc"); rewind($fh); -stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, []); +if (false === @stream_filter_append($fh, 'convert.iconv.ucs-2/utf8//IGNORE', STREAM_FILTER_READ, [])) { + stream_filter_append($fh, 'convert.iconv.ucs-2/utf-8//IGNORE', STREAM_FILTER_READ, []); +} $a = stream_get_contents($fh); var_dump(strlen($a)); ?> DONE --EXPECTF-- -Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d +Warning: stream_get_contents(): iconv stream filter ("ucs-2"=>"utf%A8//IGNORE"): invalid multibyte sequence in %sbug76249.php on line %d int(3) DONE |