From a1495c8d7fe1c6e94c146d0c7c69667c985d8db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Sun, 2 Nov 2025 16:19:46 +0100 Subject: [PATCH] [XMLProcessor] Tolerate standalone="true" --- components/XML/Tests/W3CXMLConformanceTest.php | 12 +----------- components/XML/class-xmlprocessor.php | 8 -------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/components/XML/Tests/W3CXMLConformanceTest.php b/components/XML/Tests/W3CXMLConformanceTest.php index 012f6686..e5b09101 100644 --- a/components/XML/Tests/W3CXMLConformanceTest.php +++ b/components/XML/Tests/W3CXMLConformanceTest.php @@ -59,21 +59,11 @@ public function test_w3c_xml_test_case($test_id, $test_type, $test_file, $descri } if (in_array($test_id, [ - "not-sa01", - "not-sa02", - "not-sa03", "not-sa04", "sa04", "ibm-valid-P01-ibm01v01.xml", - "ibm-valid-P32-ibm32v01.xml", - "ibm-valid-P32-ibm32v02.xml", - "ibm-valid-P32-ibm32v03.xml", - "ibm-valid-P32-ibm32v04.xml", - "ibm-valid-P68-ibm68v02.xml", - "ibm-valid-P69-ibm69v01.xml", - "ibm-valid-P69-ibm69v02.xml", ])) { - $this->markTestSkipped("Skipping test case: {$test_id} – XMLProcessor does not support standalone documents"); + $this->markTestSkipped("Skipping test case: {$test_id} – XMLProcessor does not support custom processing directive targets (e.g. )"); return; } diff --git a/components/XML/class-xmlprocessor.php b/components/XML/class-xmlprocessor.php index 772cb7b5..9ddea8ae 100644 --- a/components/XML/class-xmlprocessor.php +++ b/components/XML/class-xmlprocessor.php @@ -21,7 +21,6 @@ * – XML 1.0 * – Well-formed * – UTF-8 encoded - * – Not standalone (so can use external entities) * – No external DTD subset expansion (external entities may exist but are not fetched). * * XML 1.1 is explicitly not a design goal here. Version 1.1 is @@ -2073,13 +2072,6 @@ private function parse_next_tag() { return false; } - if ( null !== $this->get_qualified_attribute( 'standalone' ) - && 'YES' !== strtoupper( $this->get_qualified_attribute( 'standalone' ) ) - ) { - $this->bail( 'Standalone XML documents are not supported.', self::ERROR_UNSUPPORTED ); - return false; - } - $at = $this->bytes_already_parsed; // Skip whitespace.