From 98e832d29ec709b7ade9ddee70b8713e241b050d Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Tue, 6 Mar 2007 20:04:05 +0000 Subject: [PATCH] Fix handling over overridden file:// wrapper --- main/streams/streams.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main/streams/streams.c b/main/streams/streams.c index 305461512a..de3715855e 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -2138,18 +2138,18 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char if (options & STREAM_LOCATE_WRAPPERS_ONLY) { return NULL; } - + /* The file:// wrapper may have been disabled/overridden */ - if (FG(stream_wrappers)) { - if (!wrapperpp || zend_hash_find(wrapper_hash, "file", sizeof("file"), (void**)&wrapperpp) == FAILURE) { + if (FG(stream_wrappers)) { + if (zend_hash_find(wrapper_hash, "file", sizeof("file"), (void**)&wrapperpp) == FAILURE) { if (options & REPORT_ERRORS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Plainfiles wrapper disabled"); } return NULL; + } else { + /* Handles overridden plain files wrapper */ + plain_files_wrapper = *wrapperpp; } - - /* Handles overridden plain files wrapper */ - plain_files_wrapper = *wrapperpp; } if (!php_stream_allow_url_fopen("file", sizeof("file") - 1) || -- 2.50.1