]> granicus.if.org Git - php/commitdiff
fix bug #29723 (file_get_contents() fails with the file:// wrapper under Win32)
authorAntony Dovgal <tony2001@php.net>
Tue, 31 Aug 2004 11:37:02 +0000 (11:37 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 31 Aug 2004 11:37:02 +0000 (11:37 +0000)
main/streams/streams.c

index fc3d893e095b5cbaad93c40f76967e97a34146ff..a7c65dde57ce336f4c905c918c1b8f430d925994 100755 (executable)
@@ -1454,7 +1454,11 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char
        }
        /* TODO: curl based streams probably support file:// properly */
        if (!protocol || !strncasecmp(protocol, "file", n))     {
+#ifdef PHP_WIN32               
+               if (protocol && path[n+1] == '/' && path[n+2] == '/' && path[n+4] != ':')       {
+#else
                if (protocol && path[n+1] == '/' && path[n+2] == '/' && path[n+3] != '/')       {
+#endif
                        if (options & REPORT_ERRORS) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "remote host file access not supported, %s", path);
                        }