From: Antony Dovgal Date: Thu, 3 Aug 2006 14:17:58 +0000 (+0000) Subject: MFH: fix #38276 (file_exists() works incorrectly with long filenames on Windows) X-Git-Tag: php-5.2.0RC2~110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5cff1c6e7e83cad9c3d2b4ec68777e585c4baa4b;p=php MFH: fix #38276 (file_exists() works incorrectly with long filenames on Windows) --- diff --git a/NEWS b/NEWS index b6bec599f3..4c411c6c0b 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,8 @@ PHP NEWS (Tony) - Fixed bug #38278 (session_cache_expire()'s value does not match phpinfo's session.cache_expire). (Tony) +- Fixed bug #38276 (file_exists() works incorrectly with long filenames + on Windows). (Ilia, Tony) - Fixed bug #38269 (fopen wrapper doesn't fail on invalid hostname with curlwrappers enabled). (Tony) - Fixed bug #38261 (openssl_x509_parse() leaks with invalid cert) (Pierre) diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index 59a6b81d1d..3c713a1f79 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -706,7 +706,9 @@ CWD_API FILE *virtual_fopen(const char *path, const char *mode TSRMLS_DC) } CWD_STATE_COPY(&new_state, &CWDG(cwd)); - virtual_file_ex(&new_state, path, NULL, 1); + if (virtual_file_ex(&new_state, path, NULL, 1)) { + return -1; + } f = fopen(new_state.cwd, mode);