Skip to content

Instantly share code, notes, and snippets.

@cmb69

cmb69/.diff Secret

Created April 19, 2021 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmb69/c0b2514b4d5ca6de867b1d3953725d84 to your computer and use it in GitHub Desktop.
Save cmb69/c0b2514b4d5ca6de867b1d3953725d84 to your computer and use it in GitHub Desktop.
Fix for PHP bug #80970?
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 73421a7588..f786f01f12 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) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment