From: Ilia Alshanetsky Date: Wed, 10 Sep 2003 00:22:10 +0000 (+0000) Subject: Fixed bug #14049 (realpath() w/ZTS returns invalid results for non-existent X-Git-Tag: RELEASE_0_7~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29e829fdcf8981df41aa45a1c0918880aa44b02b;p=php Fixed bug #14049 (realpath() w/ZTS returns invalid results for non-existent paths) --- diff --git a/ext/standard/file.c b/ext/standard/file.c index c6829ae66b..ee2a847a09 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -43,6 +43,7 @@ #include #include #ifdef PHP_WIN32 +#include #define O_RDONLY _O_RDONLY #include "win32/param.h" #include "win32/winutil.h" @@ -1939,6 +1940,15 @@ PHP_FUNCTION(realpath) convert_to_string_ex(path); if (VCWD_REALPATH(Z_STRVAL_PP(path), resolved_path_buff)) { +#if ZTS +# if PHP_WIN32 + if (_access(resolved_path_buff, 0)) + RETURN_FALSE; +# else + if (access(resolved_path_buff, F_OK)) + RETURN_FALSE; +# endif +#endif RETURN_STRING(resolved_path_buff, 1); } else { RETURN_FALSE;