Commit 195b7b556e1 for php.net
commit 195b7b556e19a3dda95fbae418bcf34a0e10c3ae
Author: Kamil Tekiela <tekiela246@gmail.com>
Date: Tue Aug 11 18:40:57 2026 +0100
Collapse if statement in php_stat (#23219)
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 96669a80934..13478b6f5c3 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -736,12 +736,12 @@ PHPAPI void php_stat(zend_string *filename, int type, zval *return_value)
RETURN_FALSE;
}
if (IS_ACCESS_CHECK(type)) {
- if ((wrapper = php_stream_locate_url_wrapper(ZSTR_VAL(filename), &local, 0)) == &php_plain_files_wrapper
- && php_check_open_basedir(local)) {
- RETURN_FALSE;
- }
-
+ wrapper = php_stream_locate_url_wrapper(ZSTR_VAL(filename), &local, 0);
if (wrapper == &php_plain_files_wrapper) {
+ if (php_check_open_basedir(local)) {
+ RETURN_FALSE;
+ }
+
char realpath[MAXPATHLEN];
const char *file_path_to_check;
/* if the wrapper is not found, we need to expand path to match open behavior */