588 Commits
Author SHA1 Message Date
Ilija Tovilo 9705fda1bb Merge branch 'PHP-8.6' into master
* PHP-8.6:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:34:56 +02:00
Ilija Tovilo d6373dfe15 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:33:23 +02:00
Ilija Tovilo c7273b9ba8 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:30:04 +02:00
Ilija Tovilo 8a94bb3822 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:27:03 +02:00
Ilija Tovilo c1a5f468d0 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add NEWS entry
  Avoid state corruption via bailout
2026-10-21 16:12:35 +02:00
3584a98bda Avoid state corruption via bailout
- Replace bailout on OOM with UnwindExit
- Properly reset various globals that may be accessed during startup

Fix GHSA-w8hw-w9fx-j79w (CVE-2026-109618)
Fix GHSA-6wmf-4rv5-p3rp (CVE-2026-109619)

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Jakub Zelenka <bukka@php.net>
Co-authored-by: Nora Dossche <7771979+ndossche@users.noreply.github.com>
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
2026-10-21 16:06:22 +02:00
lacatoire b2163be5ff Clear the libxml last error in libxml_use_internal_errors(false)
libxml_use_internal_errors(false) destroyed the internal error list but
left libxml's own last error in place. libxml_get_last_error() falls
back to it once the list is gone, so it kept returning an error while
libxml_get_errors() was empty, although the documentation says that
disabling clears the existing errors.

Reset the last error when the list is destroyed. Calling the function
again while the internal errors are already disabled leaves it alone.

Closes GH-24295.
2026-10-14 22:46:03 +02:00
Ilia Alshanetsky 65f7c719a3 Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
  ext/libxml: Keep SimpleXML children alive across reconstruction
2026-09-29 14:53:12 -04:00
Ilia Alshanetsky e926c2a2ec Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/libxml: Keep SimpleXML children alive across reconstruction
2026-09-29 14:16:24 -04:00
Ilia Alshanetsky efb8ad276d ext/libxml: Keep SimpleXML children alive across reconstruction
Reconstructing a SimpleXMLElement decremented the shared node and then
installed a new document while the old pointer was still set, so the
second decrement freed a node a child object still held. Clear the
pointer before the new node is installed.

Closes GH-23931
2026-09-29 14:06:21 -04:00
Shivam Mathur e783539fe5 Merge branch 'PHP-8.5'
* PHP-8.5:
  Avoid closing libxml output encoder twice (#23678)
2026-09-13 23:30:49 +05:30
Shivam Mathur 2f0362e2b1 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Avoid closing libxml output encoder twice (#23678)
2026-09-13 23:30:15 +05:30
Shivam Mathur c36758eefb Avoid closing libxml output encoder twice (#23678) 2026-09-13 23:29:47 +05:30
Dmytro Kulyk 67135cb97b gen_stub: Conditionally include zend_attributes.h to arginfo based on usage (#21570)
Headers required by the generated code (zend_attributes.h, zend_constants.h, zend_enum.h) are collected during generation and emitted as includes at the top of the arginfo file, with the same preprocessor conditions and PHP version guards as the code that needs them.

Removes the manual zend_attributes.h and zend_enum.h includes from sources that only needed them for the arginfo file they include.
2026-09-06 21:25:20 +02:00
NickSdot 2f981224b0 ext/libxml: applied fixers to improve test robustness (#23024) 2026-08-22 14:03:25 +01:00
Shivam Mathur 6fb0e4f8d5 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/libxml: Export xmlCtxtSetOptions on Windows (#23178)
2026-08-09 12:02:17 +05:30
Shivam Mathur 54ca918637 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/libxml: Export xmlCtxtSetOptions on Windows (#23178)
2026-08-09 12:02:07 +05:30
Shivam Mathur 4d0fbd43c0 ext/libxml: Export xmlCtxtSetOptions on Windows (#23178) 2026-08-09 12:01:31 +05:30
David Carlier 24f2ba08a1 Merge branch 'PHP-8.5'
* PHP-8.5:
  ext/libxml: Fix build failure with libxml2 2.15.
2026-08-08 20:34:44 +01:00
David Carlier 8a37b4d526 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  ext/libxml: Fix build failure with libxml2 2.15.

# Conflicts:
#	ext/libxml/config.w32
2026-08-08 20:34:40 +01:00
David Carlier bc7537dbf0 ext/libxml: Fix build failure with libxml2 2.15.
libxml2 2.15 removed the built-in HTTP client, the FTP module, the
functions in xmlunicode.h, the shell and several other legacy symbols.
The Windows export list php_libxml2.def still referenced them, so the
statically linked build failed with hundreds of unresolved external
symbols.

Keep php_libxml2_legacy.def as the original export list, unchanged, and
make php_libxml2.def the clean 2.15+ list, selecting one or the other
depending on the libxml2 version being built against.

Also adjust the ext/dom tests for the 2.15 URI change: drive letters are
no longer URI schemes on Windows, so relaxNGValidate() reports a
backslash path and xmlns="x:y" is no longer absolute.

Fix GH-22752
Close GH-22755
2026-08-08 20:34:23 +01:00
Gina Peter Banyard 34c686a5b4 stream: remove path parameter in stream error functions (#22792)
Instead rely on the mechanism gated by the error_include_args INI to display them.

This actually aligns the behaviour of what was accepted in https://wiki.php.net/rfc/display_error_function_args.
2026-07-19 16:15:01 +01:00
ndossche a61c38a70b Merge branch 'PHP-8.5'
* PHP-8.5:
  [ci skip] Update heading
  soap: do not overwrite the parsed host on a protocol-relative redirect
2026-06-25 08:31:59 +02:00
ndossche cf9bb87ec2 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  [ci skip] Update heading
  soap: do not overwrite the parsed host on a protocol-relative redirect
2026-06-25 08:31:03 +02:00
ndossche 1666d90b15 [ci skip] Update heading 2026-06-25 08:24:14 +02:00
Ilia Alshanetsky 2efafdb11d Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix MIME charset sniffing advancing by name length not value length
2026-06-17 20:14:47 -04:00
Ilia Alshanetsky eceacc6dd2 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix MIME charset sniffing advancing by name length not value length
2026-06-17 20:12:53 -04:00
Ilia Alshanetsky 98563c2d8e Fix MIME charset sniffing advancing by name length not value length
php_libxml_sniff_charset_from_string() advanced the parse cursor by the
parameter name length after collecting an unquoted parameter value
(WHATWG mime-sniff step 11.9.1), instead of the value length. When a
Content-Type parameter before charset had a name and value of different
lengths, the cursor misaligned and the charset parameter was missed, so
document loading fell back to the wrong encoding.

Closes GH-22343
2026-06-17 19:50:07 -04:00
David Carlier 9596ab1527 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-22138: skip libxml/xmlreader tests on non-ASCII paths.
2026-05-29 06:09:01 +01:00
David Carlier c956d6dfc9 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-22138: skip libxml/xmlreader tests on non-ASCII paths.
2026-05-29 06:08:52 +01:00
David Carlier 673cb6d7a3 Fix GH-22138: skip libxml/xmlreader tests on non-ASCII paths.
libxml2 2.13+ rejects unencoded non-ASCII bytes in SYSTEM URIs via
xmlBuildURISafe and emits "Can't resolve URI", which breaks four tests
when the source tree lives under a path like "~/下载/". Skip them with
a clear reason on such paths, and loosen the EXPECTF for the two tests
that previously matched only "failed to load" so both libxml2 message
formats are accepted.

close GH-22150
2026-05-29 06:08:36 +01:00
Ben Ramsey c2af0976a8 license-update: ext/libxml source headers
RFC: https://wiki.php.net/rfc/php_license_update
2026-04-11 21:20:54 -05:00
Petr Sumbera ce1cadba29 Fix Solaris tests and add nightly CI job
Closes GH-20709
2026-03-04 10:12:03 +01:00
Peter Kokot f17c5ad83b Windows build: Add new function CHECK_HEADER() (#21191)
The current function `CHECK_HEADER_ADD_INCLUDE()` automatically defines
`HAVE_<HEADER_NAME_H>` preprocessor macros, which makes it difficult to
sync with other build systems. Specially, if some `HAVE_` macro is used
in the code and this function defines this macro but Autotools doesn't.

The new `CHECK_HEADER()` function behaves similar except it doesn't
define the `HAVE_<HEADER_NAME_H>` preprocessor macro.

This removes the following unused compile definitions:

HAVE_ARGON2_H
HAVE_AVIF_H
HAVE_BZLIB_H
HAVE_CAPSTONE_CAPSTONE_H
HAVE_CURL_EASY_H
HAVE_DB_H
HAVE_DECODE_H
HAVE_DEPOT_H
HAVE_EDITLINE_READLINE_H
HAVE_ENCHANT_H
HAVE_ENCODE_H
HAVE_FFI_H
HAVE_FIREBIRD_INTERFACE_H
HAVE_FT2BUILD_H
HAVE_GD_H
HAVE_GLIB_H
HAVE_GMP_H
HAVE_HTTPD_H
HAVE_IBASE_H
HAVE_IR_IR_H
HAVE_KECCAKHASH_H
HAVE_LBER_H
HAVE_LDAP_H
HAVE_LIBEXSLT_EXSLT_H
HAVE_LIBINTL_H
HAVE_LIBPQ_FE_H
HAVE_LIBTIDY_TIDY_H
HAVE_LIBXML_PARSER_H
HAVE_LIBXML_TREE_H
HAVE_LIBXML_XMLWRITER_H
HAVE_LIBXSLT_XSLT_H
HAVE_LMDB_H
HAVE_MBSTRING_H
HAVE_MYSQL_H
HAVE_ONIGURUMA_H
HAVE_OPENSSL_SSL_H
HAVE_PNG_H
HAVE_SNMP_H
HAVE_SODIUM_H
HAVE_SQLITE3_H
HAVE_SQLITE3EXT_H
HAVE_SYBFRONT_H
HAVE_TIDY_H
HAVE_TIDY_TIDY_H
HAVE_TIDYBUFFIO_H
HAVE_TIMELIB_CONFIG_H
HAVE_UNICODE_USPOOF_H
HAVE_UNICODE_UTF_H
HAVE_XPM_H
HAVE_ZIP_H
HAVE_ZIPCONF_H
HAVE_ZLIB_H

The following compile definitions are defined explicitly:

- HAVE_ICONV_H
- HAVE_MSCOREE_H
- HAVE_SQL_H
- HAVE_SQLEXT_H

Additionally, the `SETUP_OPENSSL()` function doesn't accept the 6th
argument anymore.
2026-03-03 20:06:40 +01:00
Khaled Alam d03d69a88a Remove duplicate #include statements (#21085)
* Remove duplicate #include statements across the codebase.

* feat: Restore conditional/unconditional include pairs in lscriu.c
2026-01-30 16:37:13 +01:00
Arnaud Le Blanc 65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
Ilija Tovilo 92dc0d0db8 Merge branch 'PHP-8.5'
* PHP-8.5:
  Suppress libxml deprecations
2025-12-02 16:46:14 +01:00
Ilija Tovilo ddc8512267 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Suppress libxml deprecations
2025-12-02 16:45:39 +01:00
Ilija Tovilo ed847f49c3 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Suppress libxml deprecations
2025-12-02 16:45:31 +01:00
Ilija Tovilo 685bd9de81 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Suppress libxml deprecations
2025-12-02 16:41:37 +01:00
Ilija Tovilo 26b9395ad6 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Suppress libxml deprecations
2025-12-02 16:38:08 +01:00
Ilija Tovilo f7fb13eb07 Suppress libxml deprecations
Closes GH-20538
2025-12-02 16:37:50 +01:00
Niels Dossche e28e891791 Merge branch 'PHP-8.5'
* PHP-8.5:
  libxml: Fix input buffer deprecation
2025-11-19 18:41:56 +01:00
Niels Dossche aa9619e437 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  libxml: Fix input buffer deprecation
2025-11-19 18:41:50 +01:00
Niels Dossche 6eb10dc433 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  libxml: Fix input buffer deprecation
2025-11-19 18:41:43 +01:00
Niels Dossche 8c2407714f libxml: Fix input buffer deprecation
While this fixed the last deprecation in ext/libxml, it's not a full
fix: The full fix would be to move to the context-specific APIs to
override the behaviour. However, that requires API/ABI incompatible
changes so that can't be done on a stable branch.

Closes GH-20525.
2025-11-19 18:41:28 +01:00
Niels Dossche 9c2c341fef Merge branch 'PHP-8.5'
* PHP-8.5:
  libxml: Fix some deprecations regarding input buffer/parser handling
2025-11-18 18:54:09 +01:00
Niels Dossche 39dc317f1f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  libxml: Fix some deprecations regarding input buffer/parser handling
2025-11-18 18:54:03 +01:00
Niels Dossche 4401b03aa9 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  libxml: Fix some deprecations regarding input buffer/parser handling
2025-11-18 18:53:44 +01:00
Niels Dossche 6054a900ff libxml: Fix some deprecations regarding input buffer/parser handling
Closes GH-20514.
2025-11-18 18:53:17 +01:00