Merge branch 'PHP-8.4'

* PHP-8.4:
  Updates for libxml2 >= 2.13.0
This commit is contained in:
Christoph M. Becker 2024-10-22 00:17:44 +02:00
commit 6dd67bbb76
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
4 changed files with 8 additions and 9 deletions

View file

@ -9,7 +9,7 @@ in_array('compress.zlib', stream_get_wrappers()) or die('skip compress.zlib wrap
--FILE-- --FILE--
<?php <?php
$dom = new domdocument; $dom = new domdocument;
$dom->load("compress.zlib://".__DIR__."/book.xml.gz"); $dom->load("compress.zlib://" . str_replace("\\", "/", __DIR__) . "/book.xml.gz");
print $dom->saveXML(); print $dom->saveXML();
?> ?>
--EXPECT-- --EXPECT--

View file

@ -423,10 +423,11 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
(xmlStrncmp(BAD_CAST uri->scheme, BAD_CAST "file", 4) == 0))) { (xmlStrncmp(BAD_CAST uri->scheme, BAD_CAST "file", 4) == 0))) {
resolved_path = xmlURIUnescapeString(filename, 0, NULL); resolved_path = xmlURIUnescapeString(filename, 0, NULL);
isescaped = 1; isescaped = 1;
#if LIBXML_VERSION >= 20902 && defined(PHP_WIN32) #if LIBXML_VERSION >= 20902 && LIBXML_VERSION < 21300 && defined(PHP_WIN32)
/* Libxml 2.9.2 prefixes local paths with file:/ instead of file://, /* Libxml 2.9.2 prefixes local paths with file:/ instead of file://,
thus the php stream wrapper will fail on a valid case. For this thus the php stream wrapper will fail on a valid case. For this
reason the prefix is rather better cut off. */ reason the prefix is rather better cut off.
As of libxml 2.13.0 this issue is resolved. */
{ {
size_t pre_len = sizeof("file:/") - 1; size_t pre_len = sizeof("file:/") - 1;

View file

@ -1,12 +1,11 @@
--TEST-- --TEST--
Bug #69753 - libXMLError::file contains invalid URI Bug #69753 - libXMLError::file contains invalid URI
--XFAIL--
Awaiting upstream fix: https://gitlab.gnome.org/GNOME/libxml2/-/issues/611
--EXTENSIONS-- --EXTENSIONS--
dom dom
--SKIPIF-- --SKIPIF--
<?php <?php
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only"); if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
if (version_compare(LIBXML_DOTTED_VERSION, "2.13.0") < 0) die("skip fails for libxml2 < 2.13.0; https://gitlab.gnome.org/GNOME/libxml2/-/issues/611");
?> ?>
--FILE-- --FILE--
<?php <?php
@ -17,4 +16,4 @@ $error = libxml_get_last_error();
var_dump($error->file); var_dump($error->file);
?> ?>
--EXPECTF-- --EXPECTF--
string(%d) "file:///%s/ext/libxml/tests/bug69753.xml" string(%d) "%s\ext\libxml\tests\bug69753私はガラスを食べられます.xml"

View file

@ -1,12 +1,11 @@
--TEST-- --TEST--
Bug #69753 - libXMLError::file contains invalid URI Bug #69753 - libXMLError::file contains invalid URI
--XFAIL--
Awaiting upstream fix: https://gitlab.gnome.org/GNOME/libxml2/-/issues/611
--EXTENSIONS-- --EXTENSIONS--
dom dom
--SKIPIF-- --SKIPIF--
<?php <?php
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only"); if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
if (version_compare(LIBXML_DOTTED_VERSION, "2.13.0") < 0) die("skip fails for libxml2 < 2.13.0; https://gitlab.gnome.org/GNOME/libxml2/-/issues/611");
?> ?>
--FILE-- --FILE--
<?php <?php
@ -17,4 +16,4 @@ $error = libxml_get_last_error();
var_dump($error->file); var_dump($error->file);
?> ?>
--EXPECTF-- --EXPECTF--
string(%d) "file:///%s/ext/libxml/tests/bug69753.xml" string(%d) "%s\ext\libxml\tests\bug69753.xml"