From dbccbdeebc1e9b2ce984ebfabe112668549b8845 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 10 Apr 2026 07:57:12 -0400 Subject: [PATCH] Fix build: use php_globfree wrapper in ZipArchive::addGlob early returns GH-21702 added two `globfree()` calls at the no-match and open_basedir reject paths, but called `globfree` directly instead of the `php_globfree` wrapper used at the success path below. PHP-8.5 dropped the direct `` include from `ext/zip/php_zip.c` in favor of the `php_glob.h` wrapper, so the build now breaks with `-Werror=implicit-function-declaration` on systems where `` isn't transitively included. Match the existing wrapper usage at line 675. --- ext/zip/php_zip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index d6060d95ce8f..5202e9280ba0 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -636,14 +636,14 @@ int php_zip_glob(char *pattern, int pattern_len, zend_long flags, zval *return_v /* now catch the FreeBSD style of "no matches" */ if (!globbuf.gl_pathc || !globbuf.gl_pathv) { - globfree(&globbuf); + php_globfree(&globbuf); return 0; } /* we assume that any glob pattern will match files from one directory only so checking the dirname of the first match should be sufficient */ if (ZIP_OPENBASEDIR_CHECKPATH(globbuf.gl_pathv[0])) { - globfree(&globbuf); + php_globfree(&globbuf); return -1; }