Skip to content

Commit 6dd67bb

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Updates for libxml2 >= 2.13.0
2 parents 4214d78 + 30dd291 commit 6dd67bb

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

ext/dom/tests/dom004.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ in_array('compress.zlib', stream_get_wrappers()) or die('skip compress.zlib wrap
99
--FILE--
1010
<?php
1111
$dom = new domdocument;
12-
$dom->load("compress.zlib://".__DIR__."/book.xml.gz");
12+
$dom->load("compress.zlib://" . str_replace("\\", "/", __DIR__) . "/book.xml.gz");
1313
print $dom->saveXML();
1414
?>
1515
--EXPECT--

ext/libxml/libxml.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,11 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
423423
(xmlStrncmp(BAD_CAST uri->scheme, BAD_CAST "file", 4) == 0))) {
424424
resolved_path = xmlURIUnescapeString(filename, 0, NULL);
425425
isescaped = 1;
426-
#if LIBXML_VERSION >= 20902 && defined(PHP_WIN32)
426+
#if LIBXML_VERSION >= 20902 && LIBXML_VERSION < 21300 && defined(PHP_WIN32)
427427
/* Libxml 2.9.2 prefixes local paths with file:/ instead of file://,
428428
thus the php stream wrapper will fail on a valid case. For this
429-
reason the prefix is rather better cut off. */
429+
reason the prefix is rather better cut off.
430+
As of libxml 2.13.0 this issue is resolved. */
430431
{
431432
size_t pre_len = sizeof("file:/") - 1;
432433

ext/libxml/tests/bug69753-mb.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
--TEST--
22
Bug #69753 - libXMLError::file contains invalid URI
3-
--XFAIL--
4-
Awaiting upstream fix: https://gitlab.gnome.org/GNOME/libxml2/-/issues/611
53
--EXTENSIONS--
64
dom
75
--SKIPIF--
86
<?php
97
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
8+
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");
109
?>
1110
--FILE--
1211
<?php
@@ -17,4 +16,4 @@ $error = libxml_get_last_error();
1716
var_dump($error->file);
1817
?>
1918
--EXPECTF--
20-
string(%d) "file:///%s/ext/libxml/tests/bug69753.xml"
19+
string(%d) "%s\ext\libxml\tests\bug69753私はガラスを食べられます.xml"

ext/libxml/tests/bug69753.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
--TEST--
22
Bug #69753 - libXMLError::file contains invalid URI
3-
--XFAIL--
4-
Awaiting upstream fix: https://gitlab.gnome.org/GNOME/libxml2/-/issues/611
53
--EXTENSIONS--
64
dom
75
--SKIPIF--
86
<?php
97
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
8+
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");
109
?>
1110
--FILE--
1211
<?php
@@ -17,4 +16,4 @@ $error = libxml_get_last_error();
1716
var_dump($error->file);
1817
?>
1918
--EXPECTF--
20-
string(%d) "file:///%s/ext/libxml/tests/bug69753.xml"
19+
string(%d) "%s\ext\libxml\tests\bug69753.xml"

0 commit comments

Comments
 (0)