From: Wez Furlong Date: Mon, 9 Dec 2002 10:34:32 +0000 (+0000) Subject: Fix for bug #20831; include() from UNC paths does not work. X-Git-Tag: php-4.3.0RC3~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5650d9fdd1ff183d73b0cbc3c9529e3b2652ac51;p=php Fix for bug #20831; include() from UNC paths does not work. --- diff --git a/main/streams.c b/main/streams.c index 5bd0d50c82..4242d33538 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1749,7 +1749,16 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha if (fp) { /* sanity checks for include/require */ if (options & STREAM_OPEN_FOR_INCLUDE && (fstat(fileno(fp), &st) == -1 || !S_ISREG(st.st_mode))) { - goto err; + int is_unc = 0; + +#ifdef PHP_WIN32 + /* skip the sanity check; fstat doesn't appear to work on + * UNC paths */ + is_unc = (filename[0] == '\\' && filename[1] == '\\'); +#endif + if (!is_unc) { + goto err; + } } ret = php_stream_fopen_from_file_rel(fp, mode);