From 9bbaaffc268a2221a44462d68ae86081be5e0c9f Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 25 May 2026 23:11:41 +0100 Subject: [PATCH] Fix GH-22138: skip libxml/xmlreader tests on non-ASCII paths. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libxml2 2.13+ rejects unencoded non-ASCII bytes in SYSTEM URIs via xmlBuildURISafe and emits "Can't resolve URI", which breaks four tests when the source tree lives under a path like "~/下载/". Skip them with a clear reason on such paths, and loosen the EXPECTF for the two tests that previously matched only "failed to load" so both libxml2 message formats are accepted. --- ext/libxml/tests/bug61367-read_2.phpt | 3 ++- ext/libxml/tests/libxml_disable_entity_loader_2.phpt | 3 ++- .../tests/libxml_entity_loading_disabled_by_default.phpt | 4 ++++ ext/xmlreader/tests/012.phpt | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ext/libxml/tests/bug61367-read_2.phpt b/ext/libxml/tests/bug61367-read_2.phpt index f4b0f300293c..ec4ce827336b 100644 --- a/ext/libxml/tests/bug61367-read_2.phpt +++ b/ext/libxml/tests/bug61367-read_2.phpt @@ -5,6 +5,7 @@ dom --SKIPIF-- = 2.9.12 only'); +if (preg_match('/[^\x00-\x7F]/', __DIR__)) die('skip path contains non-ASCII characters that libxml URI parser rejects'); ?> --INI-- open_basedir=. @@ -58,6 +59,6 @@ bool(true) int(4) bool(true) -%s: DOMDocument::loadXML(): %Sfailed to load %s +%s: DOMDocument::loadXML(): %s Warning: Attempt to read property "nodeValue" on null in %s on line %d diff --git a/ext/libxml/tests/libxml_disable_entity_loader_2.phpt b/ext/libxml/tests/libxml_disable_entity_loader_2.phpt index fb71c0c8d756..be386154bb20 100644 --- a/ext/libxml/tests/libxml_disable_entity_loader_2.phpt +++ b/ext/libxml/tests/libxml_disable_entity_loader_2.phpt @@ -6,6 +6,7 @@ dom --SKIPIF-- = 2.9.12 only'); +if (preg_match('/[^\x00-\x7F]/', __DIR__)) die('skip path contains non-ASCII characters that libxml URI parser rejects'); ?> --FILE-- --FILE-- --FILE--