1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Commit Graph

441 Commits

Author SHA1 Message Date
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
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
6054a900ff libxml: Fix some deprecations regarding input buffer/parser handling
Closes GH-20514.
2025-11-18 18:53:17 +01:00
Niels Dossche
f3cb9a81fb Wrap the normally lazy-initialized components in ZTS 2025-10-14 22:14:54 +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
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
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
Jakub Zelenka
acf2f4988a Merge branch 'PHP-8.2' into PHP-8.3 2025-03-11 22:09:00 +01:00
Jakub Zelenka
4af1830356 Merge branch 'PHP-8.1' into PHP-8.2 2025-03-11 21:57:33 +01:00
Tim Düsterhus
b6004a043c 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 21:50:17 +01:00
Niels Dossche
7be950f3f6 Fix GH-17223: Memory leak in libxml encoding handling
This was a bug in both libxml and PHP.
We follow up with the same change as done in GNOME/libxml@b3871dd138.

Changing away from `xmlOutputBufferCreateFilenameDefault` is not
possible yet because this is a stable branch and would break BC.

Closes GH-17254.
2024-12-26 12:24:06 +01:00
Niels Dossche
6199289b6e Backport 3ec5919e: Update error message for libxml 2.13
External entity loading got its error level decreased in upstream,
which means they now map to E_NOTICE. Also the error message format has
changed.
2024-10-12 15:12:40 +02:00
Niels Dossche
b78618750f Backport f74f9b07: Update libxml test for the directory field behaviour change
See https://gitlab.gnome.org/GNOME/libxml2/-/issues/753.
The base directory for the entity is no longer set, follow the upstream
behaviour.
2024-10-12 15:12:40 +02:00
Niels Dossche
bb46b4b799 Backport 4fe82131: Backport libxml2 2.13.2 fixes (#14816)
Backproted from https://github.com/php/php-src/pull/14789
2024-10-12 15:12:40 +02:00
Niels Dossche
dbde99d875 Backport e2d97314: Backport deprecation warning ignores to unbreak CI
In master I use ZEND_DIAGNOSTIC_IGNORED_START, but that doesn't exist on
8.2 or 8.3 (8.3 has a similar macro though).
So to unbreak CI I just made a variation of this directly in the
php_libxml.h header.

See 683e787860 (commitcomment-134301083)
2024-10-12 15:12:40 +02:00
Niels Dossche
fa6a0f80f6 Backport 0a39890c: Fix libxml2 2.12 build due to API breaks
See https://github.com/php/php-src/actions/runs/7062192818/job/19225478601
2024-10-12 15:12:40 +02:00
Niels Dossche
79427ae08e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Update error message for libxml 2.13
  Update libxml test for the directory field behaviour change
2024-09-12 23:07:12 +02:00
Niels Dossche
3ec5919e14 Update error message for libxml 2.13
External entity loading got its error level decreased in upstream,
which means they now map to E_NOTICE. Also the error message format has
changed.
2024-09-12 23:06:25 +02:00
Niels Dossche
f74f9b073a Update libxml test for the directory field behaviour change
See https://gitlab.gnome.org/GNOME/libxml2/-/issues/753.
The base directory for the entity is no longer set, follow the upstream
behaviour.
2024-09-12 23:06:25 +02:00
Niels Dossche
ecf0bb0fd1 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Backport libxml2 2.13.2 fixes (#14816)
2024-07-04 15:37:35 +02:00
Niels Dossche
4fe821311c Backport libxml2 2.13.2 fixes (#14816)
Backproted from https://github.com/php/php-src/pull/14789
2024-07-04 15:29:50 +02:00
Niels Dossche
b63b100e36 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14563: Build failure with libxml2 v2.13.0
2024-06-29 16:28:51 +02:00
Niels Dossche
b08def5156 Fix GH-14563: Build failure with libxml2 v2.13.0
Remove xmlErrMemory from the export section for Windows, this fixes the
build. Even though the original function was renamed [1] it is hidden,
so removing this should be sufficient and not be a BC break.

[1] 130436917c

Closes GH-14719.
2024-06-29 16:28:16 +02:00
Niels Dossche
120bd364aa Fix crashes with entity references and predefined entities
Closes GH-13004.
2024-01-17 19:41:22 +01:00
Niels Dossche
5f69232b53 Revert "Fix crashes with entity references and predefined entities"
This reverts commit 3fa5af8496.
2023-12-23 17:31:18 +01:00
Niels Dossche
bb007438e2 Fix libxml2 build for 2.12.0-2.12.2 2023-12-23 17:20:52 +01:00
Niels Dossche
3fa5af8496 Fix crashes with entity references and predefined entities
There's two issues here:
- freeing of predefined entity declaration crashes (unique to 8.3 & master)
- using multiple entity references for a single entity declaration crashes
  (since forever)

The fix for the last issue is fairly easy to do on 8.3, but may require a
slightly different approach on 8.2. Therefore, for now this is 8.3-only.

Closes GH-13004.
2023-12-23 17:00:57 +01:00
Niels Dossche
f3ee902c3d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Backport deprecation warning ignores to unbreak CI
2023-12-06 22:18:12 +01:00
Niels Dossche
e2d97314ab Backport deprecation warning ignores to unbreak CI
In master I use ZEND_DIAGNOSTIC_IGNORED_START, but that doesn't exist on
8.2 or 8.3 (8.3 has a similar macro though).
So to unbreak CI I just made a variation of this directly in the
php_libxml.h header.

See 683e787860 (commitcomment-134301083)

Closes GH-12887.
2023-12-06 22:17:27 +01:00
Niels Dossche
f61f8d439c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix libxml2 2.12 build due to API breaks
2023-12-01 18:07:13 +01:00
Niels Dossche
0a39890c96 Fix libxml2 2.12 build due to API breaks
See https://github.com/php/php-src/actions/runs/7062192818/job/19225478601
2023-12-01 18:03:37 +01:00
Niels Dossche
6a76e5d0a2 Fix GH-12702: libxml2 2.12.0 issue building from src
Fixes GH-12702.

Co-authored-by: nono303 <github@nono303.net>
2023-11-22 20:39:30 -06:00
Niels Dossche
2b42b73c0b Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12616: DOM: Removing XMLNS namespace node results in invalid default: prefix
  Fix GH-12702: libxml2 2.12.0 issue building from src
2023-11-17 19:58:31 +01:00
Niels Dossche
8a95e616b9 Fix GH-12702: libxml2 2.12.0 issue building from src
Fixes GH-12702.

Co-authored-by: nono303 <github@nono303.net>
2023-11-17 19:46:30 +01:00
Niels Dossche
0cab865275 Fix compile error when php_libxml.h is included in C++
See https://github.com/php/pecl-xml-xmldiff/issues/1
2023-10-15 11:48:14 +02:00
Niels Dossche
d3273c13cb Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] Add xml and simplexml dependency to EXTENSIONS section in test
2023-10-07 21:14:24 +02:00
Niels Dossche
325b2b4a56 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] Add xml and simplexml dependency to EXTENSIONS section in test
2023-10-07 21:13:47 +02:00
Niels Dossche
6bb536e3f6 [ci skip] Add xml and simplexml dependency to EXTENSIONS section in test 2023-10-07 21:13:30 +02:00
Niels Dossche
eebc528cbf Fix broken cache invalidation with deallocated and reallocated document node
The original caching implementation had an oversight in combination with
the new lifetime management in DOM for 8.3.
The modification counter is stored on the document object itself, but as
that can get deallocated when all references disappear, stale cache data
can be used. Normally this isn't a problem, unless getElementsByTagName is
called not on the document but on a child node. Fix it by moving caching
data into the ref object, which will outlive all nodes from a document
even if the document object disappears.

Closes GH-12338.
2023-10-01 17:06:02 +02:00
Niels Dossche
df89409aba Fix compile error with -Werror=incompatible-function-pointer-types and old libxml2
libxml2 prior to 2.9.8 had a different signature for xmlHashScanner.
This signature changed in e03f0a199a
Use an #if to work around the incompatible signature.

Closes GH-12326.
2023-09-30 00:12:20 +02:00
Niels Dossche
6a2b885155 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Restore old namespace reconciliation behaviour
2023-09-27 22:40:37 +02:00
David CARLIER
e648d39e3b libxml set error structure simplification proposal (#12054) 2023-08-26 12:11:50 +01:00
Niels Dossche
e1cb721679 Improve warning when returning null from the resolver set by libxml_set_external_entity_loader
Fixes GH-11952.
Closes GH-12022.
2023-08-24 21:23:29 +02:00
Niels Dossche
bb092ab4c6 Fix #80927: Removing documentElement after creating attribute node: possible use-after-free
Closes GH-11892.
2023-08-12 18:49:12 +02:00
Niels Dossche
5018dfecdf Remove useless hashmap check
php_libxml_unlink_entity is called from a hashmap iterator, so using
xmlHashLookup to check if it comes from that hashmap will always be
true.
2023-08-07 19:53:20 +02:00
Derick Rethans
86afbe10e2 Merge branch 'PHP-8.2' 2023-07-31 19:57:02 +01:00
Derick Rethans
deddf4692a Merge branch 'PHP-8.1' into PHP-8.2 2023-07-31 19:54:44 +01:00