1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

1825 Commits

Author SHA1 Message Date
ndossche
be539d95c8 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21486: Dom\HTMLDocument parser mangles xml:space and xml:lang attributes
2026-03-22 09:58:02 +01:00
ndossche
99365b8834 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21486: Dom\HTMLDocument parser mangles xml:space and xml:lang attributes
2026-03-22 09:57:56 +01:00
ndossche
c920daa7ec Fix GH-21486: Dom\HTMLDocument parser mangles xml:space and xml:lang attributes
Closes GH-21489.
2026-03-22 09:57:26 +01:00
ndossche
46357cbaaf dom: Merge declaration and assignment 2026-03-12 17:48:38 +01:00
ndossche
28c6659b06 dom: Simplify return value management of xpath callback 2026-03-12 17:48:38 +01:00
Alexandre Daubois
11a95749b1 Convert more zend_parse_parameters_none() to fast ZPP (#21330) 2026-03-04 14:07:46 +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
Ilija Tovilo
073dcf66bb Merge branch 'PHP-8.5'
* PHP-8.5:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:28 +01:00
Ilija Tovilo
07e29acbd4 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:21 +01:00
Ilija Tovilo
6f91209260 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add RUN_RESOURCE_HEAVY_TESTS env var
2026-02-27 15:05:14 +01:00
Arshid
defc0bec2e ext/dom: Returning a boolean value using RETURN_BOOL (#21188) 2026-02-10 20:10:50 +01:00
Arshid
dcf5cd9195 ext/dom: Returning a boolean value using RETURN_BOOL (#21141) 2026-02-05 17:31:53 +01:00
Nurzhan Bazhirov
b843e03c83 Zend: Remove unused parameter from zend_dval_to_lval_cap()
The `zend_string *s` parameter became unused after commit f754ffa8b2
(GH-20746) removed the `zend_oob_string_to_long_error()` calls.

This fixes an unused-parameter compiler warning and updates a stale
comment in zend_operators.c that incorrectly stated this function
can emit warnings.

Closes GH-21112
2026-02-04 15:25:42 +01:00
Niels Dossche
f0f28b763c Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21097: Accessing Dom\Node properties can can throw TypeError(s)
2026-02-03 18:41:13 +01:00
Niels Dossche
52eb174ba6 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21097: Accessing Dom\Node properties can can throw TypeError(s)
2026-02-03 18:40:54 +01:00
Niels Dossche
b8fc6bd1c8 Fix GH-21097: Accessing Dom\Node properties can can throw TypeError(s)
Split the handler again, or defer to instanceof when performance doesn't
matter.

Closes GH-21108.
2026-02-03 18:36:28 +01:00
Arnaud Le Blanc
d16e6f52a4 Generate C enums from internal enums, introduce Z_PARAM_ENUM() (#20917)
Update gen_stubs.php to generate C enums from internal enums, when the stub is annotated with @generate-c-enums. Enum values can be compared to the result of zend_enum_fetch_case_id(zend_object*).

The generated enums are added to separate files named {$extensionName}_decl.h, so that it's possible to include these from anywhere. _arginfo.h files would generate warnings if we tried to include them in a compilation unit that doesn't call the register_{$class} functions, for instance.

Introduce Z_PARAM_ENUM().

* Make ZEND_AST_CONST_ENUM_INIT a 4-children node

* Store enum case id in ZEND_AST_CONST_ENUM_INIT

* Store enum case id in instance

* Expose enum case_id internally

* Generate C enum for internal enums

* Introduce Z_PARAM_ENUM()

* Port extensions
2026-02-03 12:38:04 +01:00
Niels Dossche
0f4f73a254 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-21077: Accessing Dom\Node::baseURI can throw TypeError
2026-01-30 18:14:24 +01:00
Niels Dossche
d54e5106b0 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21077: Accessing Dom\Node::baseURI can throw TypeError
2026-01-30 18:14:19 +01:00
Niels Dossche
d73b2f782e Fix GH-21077: Accessing Dom\Node::baseURI can throw TypeError
Prior to this patch there was a common read handler, and it relied on
the dom class set in the intern document. However, Dom\Implementation
allows creating DTDs unassociated with a document, so we can't rely on
an intern document and the check fails. This causes the ZVAL_NULL() path
to be taken.
To solve this, just split the handler.

Closes GH-21082.
2026-01-30 18:13:55 +01:00
Alexander Borisov
56e5a80c44 Fix GH-21041: Dom\HTMLDocument corrupts closing tags within scripts 2026-01-26 19:20:10 +01:00
Arnaud Le Blanc
65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
Niels Dossche
c434e046bc Remove LIBXML_XINCLUDE option from valid list of XMLDocument (#20907)
This option is only valid for pull parsers.
2026-01-11 20:38:03 +01:00
Niels Dossche
004934ce60 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20444: Dom\XMLDocument::C14N() seems broken compared to DOMDocument::C14N()
2025-12-26 22:28:55 +01:00
Niels Dossche
31ae40d5e1 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20444: Dom\XMLDocument::C14N() seems broken compared to DOMDocument::C14N()
2025-12-26 22:28:51 +01:00
Niels Dossche
40c291cf93 Fix GH-20444: Dom\XMLDocument::C14N() seems broken compared to DOMDocument::C14N()
C14N code expects namespace to be in-tree, but we store namespaces in a
different way out-of-tree to avoid reconciliations that break the tree
structure in a way unexpected by the DOM spec. In the DOM spec,
namespace nodes don't exist; they're regular attributes.
To solve this, we temporarily make fake namespace nodes that we later
remove.

Closes GH-20457.
2025-12-26 22:27:25 +01:00
Niels Dossche
b6f786a7ca Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20722: Null pointer dereference in DOM namespace node cloning via clone on malformed objects
2025-12-18 22:40:19 +01:00
Niels Dossche
735f354ac9 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20722: Null pointer dereference in DOM namespace node cloning via clone on malformed objects
2025-12-18 22:40:12 +01:00
Niels Dossche
bf63341f35 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20722: Null pointer dereference in DOM namespace node cloning via clone on malformed objects
2025-12-18 22:39:57 +01:00
Niels Dossche
983be089c0 Fix GH-20722: Null pointer dereference in DOM namespace node cloning via clone on malformed objects
Closes GH-20730.
2025-12-18 22:39:35 +01:00
Niels Dossche
cf62b6c058 [ci skip] dom: Remove outdated comment 2025-12-18 22:38:24 +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
f5024930cc Merge branch 'PHP-8.5'
* PHP-8.5:
  dom: Fix missing NUL byte check on C14NFile()
2025-11-13 00:04:04 +01:00
Niels Dossche
abad39a42a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  dom: Fix missing NUL byte check on C14NFile()
2025-11-13 00:03:56 +01:00
Niels Dossche
a103251eb2 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  dom: Fix missing NUL byte check on C14NFile()
2025-11-13 00:03:36 +01:00
Niels Dossche
8ad5915756 dom: Fix missing NUL byte check on C14NFile()
Closes GH-20466.
2025-11-13 00:03:13 +01:00
Niels Dossche
c463770c2b Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20395: \Dom\ParentNode::querySelector and \Dom\ParentNode::querySelectorAll requires elements in $selectors to be lowercase (#20409)
2025-11-12 19:34:53 +01:00
Niels Dossche
f996abde33 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20395: \Dom\ParentNode::querySelector and \Dom\ParentNode::querySelectorAll requires elements in $selectors to be lowercase (#20409)
2025-11-12 19:34:41 +01:00
Niels Dossche
3ad5799f25 Fix GH-20395: \Dom\ParentNode::querySelector and \Dom\ParentNode::querySelectorAll requires elements in $selectors to be lowercase (#20409)
The selector needs to be compared in a lowercase manner.
This also almost completely obsoletes the interned string optimization,
so get rid of that for simplicity sake. While there is still theoretical
benefit, it is only 1-2% in my random tests, not worth it anymore.
2025-11-12 19:30:58 +01:00
Niels Dossche
be3c56d5d4 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix memory leak when edge case is hit when registering xpath callback
2025-11-11 15:30:16 +01:00
Niels Dossche
131eb9e723 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix memory leak when edge case is hit when registering xpath callback
2025-11-11 15:30:11 +01:00
Niels Dossche
e504ab778c Fix memory leak when edge case is hit when registering xpath callback
This can happen if you have a valid callable name with a NUL byte in it,
on a non-interned string entry. This can be done by abusing anonymous
classes.

Closes GH-20452.
2025-11-11 15:29:45 +01:00
Niels Dossche
618e576614 Minor DOM cleanups 2025-11-11 13:41:18 +01:00
Niels Dossche
8ea8da22d0 Merge branch 'PHP-8.5'
* PHP-8.5:
  dom: Fix compile warning due to misplaced const cast
2025-11-06 22:42:54 +01:00
Niels Dossche
a0840e1428 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  dom: Fix compile warning due to misplaced const cast
2025-11-06 22:42:49 +01:00