mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Fixed bug #14049 (realpath() w/ZTS returns invalid results for non-existent
paths)
This commit is contained in:
parent
1465e10781
commit
29e829fdcf
@ -43,6 +43,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef PHP_WIN32
|
||||
#include <io.h>
|
||||
#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;
|
||||
|
Loading…
Reference in New Issue
Block a user