Skip to content

Commit e2d9ca7

Browse files
committed
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Fix #81475: stream_isatty emits warning with attached stream wrapper
2 parents c884a5a + 23e13e2 commit e2d9ca7

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ PHP NEWS
3737
. Fixed bug #69751 (Change Error message of sprintf/printf for missing/typo
3838
position specifier). (Aliaksandr Bystry)
3939

40+
- Streams:
41+
. Fixed bug #81475 (stream_isatty emits warning with attached stream wrapper).
42+
(cmb)
43+
4044
- XML:
4145
. Fixed bug #70962 (XML_OPTION_SKIP_WHITE strips embedded whitespace).
4246
(Aliaksandr Bystry, cmb)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
Bug #81475 (stream_isatty emits warning with attached stream wrapper)
3+
--FILE--
4+
<?php
5+
$stdout = fopen('php://stdout', 'wb');
6+
stream_filter_append($stdout, 'string.toupper');
7+
var_dump(stream_isatty($stdout));
8+
?>
9+
--EXPECT--
10+
bool(false)

main/streams/cast.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,9 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
293293
}
294294

295295
if (php_stream_is_filtered(stream)) {
296-
php_error_docref(NULL, E_WARNING, "Cannot cast a filtered stream on this system");
296+
if (show_err) {
297+
php_error_docref(NULL, E_WARNING, "Cannot cast a filtered stream on this system");
298+
}
297299
return FAILURE;
298300
} else if (stream->ops->cast && stream->ops->cast(stream, castas, ret) == SUCCESS) {
299301
goto exit_success;

0 commit comments

Comments
 (0)