From e65a4b0f53bdb5a368e07dd8e901edee56dfd615 Mon Sep 17 00:00:00 2001 From: Weilin Du Date: Thu, 23 Jul 2026 18:05:22 +0800 Subject: [PATCH 1/5] ext/phar: Improve various error messages (#22858) Safe mode in phar is removed in PHP 5.4, so removing them in error messages. Also fix some obvious typos in the error messages. --- NEWS | 4 ++++ ext/phar/phar_object.c | 2 +- ext/phar/tar.c | 2 +- ext/phar/tests/dir.phpt | 2 +- ext/phar/tests/mkdir.phpt | 4 ++-- ext/phar/util.c | 4 ++-- ext/phar/zip.c | 4 ++-- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 8c12e62f7c0b..63e4fdf0c244 100644 --- a/NEWS +++ b/NEWS @@ -38,6 +38,10 @@ PHP NEWS . Fixed bug GH-22665 (Out-of-bounds write when the ODBC driver reports a diagnostic message length beyond the error buffer). (iliaal) +- Phar: + . Fixed grammatical issues and outdated terminology in Phar error messages. + (Weilin Du) + - Reflection: . Fixed bug GH-22681 (Reflection*::__toString() truncates on null bytes). (DanielEScherzer) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 9859551b3ccf..0139f0889a81 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -4136,7 +4136,7 @@ ZEND_ATTRIBUTE_NONNULL static zend_result phar_extract_file(bool overwrite, phar } if (php_check_open_basedir(fullpath)) { - spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", openbasedir/safe mode restrictions in effect", ZSTR_VAL(entry->filename), fullpath); + spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", open_basedir restrictions in effect", ZSTR_VAL(entry->filename), fullpath); efree(fullpath); efree(new_state.cwd); return FAILURE; diff --git a/ext/phar/tar.c b/ext/phar/tar.c index f85241ccc4e5..bc78472afce3 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -815,7 +815,7 @@ static int phar_tar_writeheaders_int(phar_entry_info *entry, void *argument) /* if (sizeof(header) != php_stream_write(fp->new, (const char *) &header, sizeof(header))) { if (fp->error) { - spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, header for file \"%s\" could not be written", ZSTR_VAL(entry->phar->fname), ZSTR_VAL(entry->filename)); + spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, header for file \"%s\" could not be written", ZSTR_VAL(entry->phar->fname), ZSTR_VAL(entry->filename)); } return ZEND_HASH_APPLY_STOP; } diff --git a/ext/phar/tests/dir.phpt b/ext/phar/tests/dir.phpt index db5d0262add5..84645e41d9d3 100644 --- a/ext/phar/tests/dir.phpt +++ b/ext/phar/tests/dir.phpt @@ -71,7 +71,7 @@ Warning: mkdir(): phar error: cannot create directory "fails" in phar "%sok.phar Warning: mkdir(): phar error: cannot create directory "sub" in phar "%sok.phar", directory already exists in %sdir.php on line %d -Warning: mkdir(): phar error: cannot create directory "sub/directory.txt" in phar "%sok.phar", phar error: path "sub/directory.txt" exists and is a not a directory in %sdir.php on line %d +Warning: mkdir(): phar error: cannot create directory "sub/directory.txt" in phar "%sok.phar", phar error: path "sub/directory.txt" exists and is not a directory in %sdir.php on line %d Warning: mkdir(): internal corruption of phar "%soops.phar" (truncated manifest at stub end) in %sdir.php on line %d diff --git a/ext/phar/tests/mkdir.phpt b/ext/phar/tests/mkdir.phpt index 2c1586b0de5c..9955574caacd 100644 --- a/ext/phar/tests/mkdir.phpt +++ b/ext/phar/tests/mkdir.phpt @@ -42,13 +42,13 @@ Warning: mkdir(): phar error: cannot create directory "phar://", no phar archive Warning: mkdir(): phar error: cannot create directory "" in phar "foo.phar", phar error: invalid path "" must not be empty in %smkdir.php on line %d -Warning: mkdir(): phar error: cannot create directory "a" in phar "%smkdir.phar.php", phar error: path "a" exists and is a not a directory in %smkdir.php on line %d +Warning: mkdir(): phar error: cannot create directory "a" in phar "%smkdir.phar.php", phar error: path "a" exists and is not a directory in %smkdir.php on line %d Warning: rmdir(): phar error: cannot remove directory "phar://", no phar archive specified, or phar archive does not exist in %smkdir.php on line %d Warning: rmdir(): phar error: cannot remove directory "" in phar "foo.phar", directory does not exist in %smkdir.php on line %d -Warning: rmdir(): phar error: cannot remove directory "a" in phar "%smkdir.phar.php", phar error: path "a" exists and is a not a directory in %smkdir.php on line %d +Warning: rmdir(): phar error: cannot remove directory "a" in phar "%smkdir.phar.php", phar error: path "a" exists and is not a directory in %smkdir.php on line %d Cannot create a directory in magic ".phar" directory Cannot create a directory in magic ".phar" directory bool(true) diff --git a/ext/phar/util.c b/ext/phar/util.c index 1f94be5a269d..c78ee50ece15 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -1226,7 +1226,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si if (!entry->is_dir && dir == 2) { /* user requested a directory, we must return one */ if (error) { - spprintf(error, 4096, "phar error: path \"%s\" exists and is a not a directory", path); + spprintf(error, 4096, "phar error: path \"%s\" exists and is not a directory", path); } return NULL; } @@ -1290,7 +1290,7 @@ phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, si efree(test); /* user requested a directory, we must return one */ if (error) { - spprintf(error, 4096, "phar error: path \"%s\" exists and is a not a directory", path); + spprintf(error, 4096, "phar error: path \"%s\" exists and is not a directory", path); } return NULL; } diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 3085ee80c9aa..8703979f234b 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -959,7 +959,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ } if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, false)) { - spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", ZSTR_VAL(entry->filename), ZSTR_VAL(entry->phar->fname)); + spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", ZSTR_VAL(entry->filename), ZSTR_VAL(entry->phar->fname)); return ZEND_HASH_APPLY_STOP; } @@ -1008,7 +1008,7 @@ static int phar_zip_changed_apply_int(phar_entry_info *entry, void *arg) /* {{{ if (-1 == phar_seek_efp(entry, 0, SEEK_SET, 0, false)) { php_stream_filter_free(filter); - spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", ZSTR_VAL(entry->filename), ZSTR_VAL(entry->phar->fname)); + spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", ZSTR_VAL(entry->filename), ZSTR_VAL(entry->phar->fname)); return ZEND_HASH_APPLY_STOP; } From 742ff0e42af80003ff882c60d24f4c8e28b667b8 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 23 Jul 2026 13:13:02 +0200 Subject: [PATCH 2/5] [skip ci] Revert "CI: Revert timeout fix for Symfony community build (#22682)" This reverts commit 841b5bfcf20daa97cdd682949df1b980d9359442. --- .github/workflows/test-suite.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index efe5a650d2c6..b51dfbd957c5 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -573,6 +573,10 @@ jobs: php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);' # Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668 php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("public function testCastNonTrailingCharPointer()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);' + # Causes massive amounts of system calls with USE_ZEND_ALLOC=0, exceeding the timeout + if [ -e 'src/Symfony/Component/Console/Tests/Helper/FileInputHelperTest.php' ]; then + php -r '$c = file_get_contents("src/Symfony/Component/Console/Tests/Helper/FileInputHelperTest.php"); $c = str_replace("public function testReadWithPasteDetectionAbortsBeyondMaxBytes()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testReadWithPasteDetectionAbortsBeyondMaxBytes()", $c); file_put_contents("src/Symfony/Component/Console/Tests/Helper/FileInputHelperTest.php", $c);' + fi export SYMFONY_DEPRECATIONS_HELPER=max[total]=999 X=0 for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do From fd9e347fb9f110f7be76db9bc675065c8e65b74f Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 23 Jul 2026 13:27:00 +0200 Subject: [PATCH 3/5] [skip ci] Disable opcache.file_cache_only for gh22782.phpt Preloading is not compatible opcache.file_cache_only=0. --- Zend/tests/first_class_callable/constexpr/gh22782.phpt | 1 + 1 file changed, 1 insertion(+) diff --git a/Zend/tests/first_class_callable/constexpr/gh22782.phpt b/Zend/tests/first_class_callable/constexpr/gh22782.phpt index b30820be9805..e2f5d007263e 100644 --- a/Zend/tests/first_class_callable/constexpr/gh22782.phpt +++ b/Zend/tests/first_class_callable/constexpr/gh22782.phpt @@ -7,6 +7,7 @@ opcache.enable=1 opcache.enable_cli=1 opcache.optimization_level=-1 opcache.preload={PWD}/gh22782.inc +opcache.file_cache_only=0 --SKIPIF-- Date: Thu, 23 Jul 2026 12:45:38 +0100 Subject: [PATCH 4/5] ext/gd: conflicting iconv_t typedef breaking the Solaris build. (#22810) The gd 2.4 sync guarded gdkanji.c's 'typedef void *iconv_t' fallback with HAVE_ICONV_T_DEF, which the bundled build never defined. On Solaris declares iconv_t as a struct pointer, so it clashed. Define HAVE_ICONV_T_DEF when already provides iconv_t. --- ext/gd/config.m4 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index b32735bc4a69..17f508be2a9a 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -394,6 +394,14 @@ if test "$PHP_GD" != "no"; then AC_DEFINE([HAVE_GD_PNG_GET_VERSION_STRING], [1], [Define to 1 if GD library has the 'gdPngGetVersionString' function.]) + dnl Some systems (e.g. Solaris) declare iconv_t in as something + dnl other than 'void *'. The bundled libgd/gdkanji.c only falls back to its + dnl own 'typedef void *iconv_t' when HAVE_ICONV_T_DEF is undefined, so detect + dnl the system definition to avoid a conflicting typedef. + AC_EGREP_HEADER([typedef.*iconv_t], [iconv.h], + [AC_DEFINE([HAVE_ICONV_T_DEF], [1], + [Define to 1 if defines iconv_t.])]) + dnl Various checks for GD features PHP_SETUP_ZLIB([GD_SHARED_LIBADD]) PHP_GD_PNG From c329a71037c194dc0e37d829178486aa81fbf057 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 23 Jul 2026 19:32:07 +0530 Subject: [PATCH 5/5] ext/gd: remove libde265 and x265 checks on Windows (#22869) --- ext/gd/config.w32 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index ce1dc1119777..a34e9ea8a555 100644 --- a/ext/gd/config.w32 +++ b/ext/gd/config.w32 @@ -66,9 +66,7 @@ if (PHP_GD != "no") { heif_location = false; } if (heif_location && heif_location.match(/heif_a\.lib$/)) { - if (!(CHECK_LIB("libde265_a.lib", "gd", PHP_GD) && - CHECK_LIB("x265_a.lib", "gd", PHP_GD) && - CHECK_LIB("aom_a.lib", "gd", PHP_GD) && + if (!(CHECK_LIB("aom_a.lib", "gd", PHP_GD) && CHECK_LIB("dav1d_a.lib", "gd", PHP_GD))) { WARNING("static libheif not enabled; codec libraries not found"); heif_location = false;