]> granicus.if.org Git - php/commitdiff
Fix handling over overridden file:// wrapper
authorSara Golemon <pollita@php.net>
Tue, 6 Mar 2007 20:04:05 +0000 (20:04 +0000)
committerSara Golemon <pollita@php.net>
Tue, 6 Mar 2007 20:04:05 +0000 (20:04 +0000)
main/streams/streams.c

index 305461512afab9c18044ea85e1b392c611d3818b..de3715855e51c4b977d157e072f7d5edca834a56 100755 (executable)
@@ -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) ||