From adfff447d6b828b6aac3d6da30f91dbdc4f38f3b Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 28 Apr 2021 11:44:39 +0200 Subject: [PATCH] Allow to cast filtered streams to PHP_STREAM_AS_FD_FOR_SELECT --- main/streams/cast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/streams/cast.c b/main/streams/cast.c index 73421a75880c8..f786f01f124d4 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -294,7 +294,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show } } - if (php_stream_is_filtered(stream)) { + if (php_stream_is_filtered(stream) && castas != PHP_STREAM_AS_FD_FOR_SELECT) { 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) {