We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1465e10 commit 29e829fCopy full SHA for 29e829f
1 file changed
ext/standard/file.c
@@ -43,6 +43,7 @@
43
#include <sys/stat.h>
44
#include <fcntl.h>
45
#ifdef PHP_WIN32
46
+#include <io.h>
47
#define O_RDONLY _O_RDONLY
48
#include "win32/param.h"
49
#include "win32/winutil.h"
@@ -1939,6 +1940,15 @@ PHP_FUNCTION(realpath)
1939
1940
convert_to_string_ex(path);
1941
1942
if (VCWD_REALPATH(Z_STRVAL_PP(path), resolved_path_buff)) {
1943
+#if ZTS
1944
+# if PHP_WIN32
1945
+ if (_access(resolved_path_buff, 0))
1946
+ RETURN_FALSE;
1947
+# else
1948
+ if (access(resolved_path_buff, F_OK))
1949
1950
+# endif
1951
+#endif
1952
RETURN_STRING(resolved_path_buff, 1);
1953
} else {
1954
RETURN_FALSE;
0 commit comments