From 41b201dba5ad4e663125510cee94a3852313197a Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Tue, 11 Aug 2026 17:56:55 +0100 Subject: [PATCH] Collapse if statement in php_stat --- ext/standard/filestat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 96669a809346..13478b6f5c31 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 */