Skip to content

Commit

Permalink
Merge branch 'PHP-8.0' into PHP-8.1
Browse files Browse the repository at this point in the history
* PHP-8.0:
  Fix #81475: stream_isatty emits warning with attached stream wrapper
  • Loading branch information
cmb69 committed Sep 29, 2021
2 parents 9fc6be2 + e2d9ca7 commit 41e0081
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ PHP NEWS
Doleček)
. Fixed bug #81380 (Observer may not be initialized properly). (krakjoe)

- Streams:
. Fixed bug #81475 (stream_isatty emits warning with attached stream wrapper).
(cmb)

30 Sep 2021, PHP 8.1.0RC3

- Filter:
Expand Down
10 changes: 10 additions & 0 deletions ext/standard/tests/filters/bug81475.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--TEST--
Bug #81475 (stream_isatty emits warning with attached stream wrapper)
--FILE--
<?php
$stdout = fopen('php://stdout', 'wb');
stream_filter_append($stdout, 'string.toupper');
var_dump(stream_isatty($stdout));
?>
--EXPECT--
bool(false)
4 changes: 3 additions & 1 deletion main/streams/cast.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show
}

if (php_stream_is_filtered(stream)) {
php_error_docref(NULL, E_WARNING, "Cannot cast a filtered stream on this system");
if (show_err) {
php_error_docref(NULL, E_WARNING, "Cannot cast a filtered stream on this system");
}
return FAILURE;
} else if (stream->ops->cast && stream->ops->cast(stream, castas, ret) == SUCCESS) {
goto exit_success;
Expand Down

0 comments on commit 41e0081

Please sign in to comment.