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

556 Commits

Author SHA1 Message Date
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
Niels Dossche
4191b99672 Merge branch 'PHP-8.5'
* PHP-8.5:
  Wrap the normally lazy-initialized components in ZTS
2025-10-14 22:15:15 +02:00
Niels Dossche
f601910eca Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Wrap the normally lazy-initialized components in ZTS
2025-10-14 22:15:10 +02:00
Niels Dossche
6dcabd9ac1 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Wrap the normally lazy-initialized components in ZTS
2025-10-14 22:15:01 +02:00
Niels Dossche
f3cb9a81fb Wrap the normally lazy-initialized components in ZTS 2025-10-14 22:14:54 +02:00
Niels Dossche
13505acadf Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix not thread safe RelaxNG invocations in ZTS builds
  Fix not thread safe xmlSchemaParse calls in ZTS builds
2025-10-14 22:01:09 +02:00
Niels Dossche
5a2084bc16 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix not thread safe RelaxNG invocations in ZTS builds
  Fix not thread safe xmlSchemaParse calls in ZTS builds
2025-10-14 22:01:04 +02:00
Niels Dossche
595b746c2c Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix not thread safe RelaxNG invocations in ZTS builds
  Fix not thread safe xmlSchemaParse calls in ZTS builds
2025-10-14 22:00:57 +02:00
Niels Dossche
75d8449d1f Fix not thread safe RelaxNG invocations in ZTS builds 2025-10-14 22:00:24 +02:00
SpencerMalone
f14e5fcfbd Fix not thread safe xmlSchemaParse calls in ZTS builds
By calling xmlSchemaInitTypes during MINIT.
See: https://gitlab.gnome.org/GNOME/libxml2/-/issues/930

Closes GH-20150.
2025-10-14 21:59:46 +02:00
Niels Dossche
57ce245e1e Reduce code bloat in arginfo by using specialised string releases (#20016)
* Reduce code bloat in arginfo by using specialised string releases

Comparing this patch to master (c7da728574),
with a plain configure command without any options:

```
   text	   data	    bss	    dec	    hex	filename
20683738	1592400	 137712	22413850	156021a	sapi/cli/php
20688522	1592400	 137712	22418634	15614ca	sapi/cli/php_old
```

We see a minor reduction of 0.023% in code size.

* Also use true for the other initialization line

* Also use specialized code for consts
2025-10-02 22:00:20 +02:00
Daniel Scherzer
4de2ec3895 [RFC] Deprecate xml_parser_free() (#19449)
https://wiki.php.net/rfc/deprecations_php_8_5
2025-08-12 05:44:32 -07:00
DanielEScherzer
1eadf553f1 Arginfo: avoid using temporary zvals for initializing attribute values (#19141)
Instead of
* adding a zval on the stack
* initializing it
* copying the value to the attribute

Just initialize the value directly in the zend_attribute_arg
2025-07-21 13:33:51 -07:00
Niels Dossche
541620cf78 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19098: libxml<2.13 segmentation fault caused by php_libxml_node_free
2025-07-20 17:20:53 +02:00
Niels Dossche
cb73155945 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19098: libxml<2.13 segmentation fault caused by php_libxml_node_free
2025-07-20 17:20:47 +02:00
Niels Dossche
312869381a Fix GH-19098: libxml<2.13 segmentation fault caused by php_libxml_node_free
This implements a workaround for reconciliation not being performed for
document-less nodes in libxml<2.13.

Closes GH-19186.
2025-07-20 17:19:43 +02:00
Niels Dossche
0962c325fa Implement SVG image handler
This implements an SVG handler using the libxml reader API. This does
not parse the entire document but instead uses a pull parser to locate
the root element, check whether it's an svg root, do some extra sanity
checks on the attribute, and fill in the php_gfxinfo structure.
2025-07-20 12:53:57 +02:00
Daniel Scherzer
142e378618 Arginfo: add and use known strings for attribute values 2025-07-14 17:31:22 -07:00
Niels Dossche
3cb7d1bd8a Remove custom UTF-8 check function from ext/libxml
This was originally introduced as a workaround for a libxml2 bug [1].
This bug has been fixed for more than a decade [2], and we can use the
libxml2 API again. We bumped our version requirement for libxml2 beyond
that in 7.4 [3].

[1] 7e53511ec8
[2] 3ffe90ea1c
[3] 74235ca5f3

Closes GH-18706.
2025-05-30 10:40:23 +02:00
Niels Dossche
efaae93e48 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18597: Heap-buffer-overflow in zend_alloc.c when assigning string with UTF-8 bytes
2025-05-20 21:32:27 +02:00
Niels Dossche
40e667280b Fix GH-18597: Heap-buffer-overflow in zend_alloc.c when assigning string with UTF-8 bytes
xmlSave() also can flush in some cases. When the encoding is not
available this can fail for short inputs, resulting in an empty string
which is interned but then wrongly tagged by RETURN_NEW_STR.
Fix this by checking the error condition and switching to RETURN_STR for
defense-in-depth.

This issue also exists on 8.3, but does not crash; however, due to the
different API usage internally I cannot easily fix it on 8.3. There it
gives a partial output.

Closes GH-18606.
2025-05-20 21:32:17 +02:00
Gina Peter Banyard
3932d9b660 ext/libxml: Get rid of useless php_libxml_func_handler abstraction 2025-04-26 13:57:17 +01:00
Gina Peter Banyard
dc036016a3 ext/libxml: Minor code nits 2025-04-26 13:57:17 +01:00
Gina Peter Banyard
d1917c918e ext/libxml: libxml_set_external_entity_loader() always returns true 2025-04-26 13:57:17 +01:00
Gina Peter Banyard
c5aa03c8b9 ext/libxml: Use bool type instead of int type 2025-04-26 13:57:17 +01:00
Gina Peter Banyard
1f1cd5c4bc ext/libxml: Add some const qualifiers 2025-04-26 13:57:17 +01:00
Gina Peter Banyard
e59c7f887b ext/libxml: Reduce scope of variables 2025-04-26 13:57:17 +01:00
Gina Peter Banyard
213949dc34 Merge branch 'PHP-8.4'
* PHP-8.4:
  ext/libxml: Fixed custom external entity loader returning an invalid resource leading to a confusing TypeError message
2025-04-07 13:01:52 +01:00
Gina Peter Banyard
1e9e397122 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  ext/libxml: Fixed custom external entity loader returning an invalid resource leading to a confusing TypeError message
2025-04-07 12:59:57 +01:00
Gina Peter Banyard
61f704f269 ext/libxml: Fixed custom external entity loader returning an invalid resource leading to a confusing TypeError message
Closes GH-18096
2025-04-07 12:58:52 +01:00
Niels Dossche
3d6f4c8bbe Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GHSA-p3x9-6h7p-cgfc: libxml streams wrong `content-type` on redirect
2025-03-11 23:00:43 +01:00
Tim Düsterhus
a8d3a80067 Fix GHSA-p3x9-6h7p-cgfc: libxml streams wrong content-type on redirect
libxml streams use wrong content-type header when requesting a
redirected resource.
2025-03-11 22:58:39 +01:00
Jakub Zelenka
acf2f4988a Merge branch 'PHP-8.2' into PHP-8.3 2025-03-11 22:09:00 +01:00