From 088e2692c3d1e680fd3d9306c4adb417e761acff Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 24 Feb 2003 21:40:23 +0000 Subject: MFB: Bunch of streams related fixes. --- main/streams/cast.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main/streams/cast.c') diff --git a/main/streams/cast.c b/main/streams/cast.c index 66acd141a3..aa6e6d12b2 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -208,7 +208,12 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show return FAILURE; #endif - if (flags & PHP_STREAM_CAST_TRY_HARD) { + if (!php_stream_is_filtered(stream) && stream->ops->cast && stream->ops->cast(stream, castas, NULL TSRMLS_CC) == SUCCESS) { + if (FAILURE == stream->ops->cast(stream, castas, ret TSRMLS_CC)) { + return FAILURE; + } + goto exit_success; + } else if (flags & PHP_STREAM_CAST_TRY_HARD) { php_stream *newstream; newstream = php_stream_fopen_tmpfile(); -- cgit v1.2.1