[php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5
| From: | David Carlier | Date: | Thu, 26 Nov 2026 05:00:39 +0000 |
| Subject: | [php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-144201@lists.php.net to get a copy of this message | ||
Author: David Carlier (devnexen)
Date: 2026-11-26T04:58:59Z
Commit: https://github.com/php/php-src/commit/351c6a9ca8da99369c279cc5adaec9f445e0780c
Raw diff: https://github.com/php/php-src/commit/351c6a9ca8da99369c279cc5adaec9f445e0780c.diff
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
ext/dom: fix Dom\Notation publicId and systemId property handlers
Changed paths:
A ext/dom/tests/modern/xml/Notation_properties.phpt
M ext/dom/php_dom.c
M ext/dom/tests/modern/xml/DTDNamedNodeMap.phpt
Diff:
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index e101ce747bb9..d3bebd5ccce1 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -1260,7 +1260,7 @@ PHP_MINIT_FUNCTION(dom)
DOM_REGISTER_PROP_HANDLER(&dom_modern_notation_prop_handlers, "publicId",
dom_notation_public_id_read, NULL);
DOM_REGISTER_PROP_HANDLER(&dom_modern_notation_prop_handlers, "systemId",
dom_notation_system_id_read, NULL);
zend_hash_merge(&dom_modern_notation_prop_handlers, &dom_modern_node_prop_handlers, NULL,
false);
- zend_hash_add_new_ptr(&classes, dom_modern_notation_class_entry->name,
&dom_modern_node_prop_handlers);
+ zend_hash_add_new_ptr(&classes, dom_modern_notation_class_entry->name,
&dom_modern_notation_prop_handlers);
dom_entity_class_entry = register_class_DOMEntity(dom_node_class_entry);
dom_entity_class_entry->create_object = dom_objects_new;
diff --git a/ext/dom/tests/modern/xml/DTDNamedNodeMap.phpt
b/ext/dom/tests/modern/xml/DTDNamedNodeMap.phpt
index f9bb1f7a996e..4f17f39e9612 100644
--- a/ext/dom/tests/modern/xml/DTDNamedNodeMap.phpt
+++ b/ext/dom/tests/modern/xml/DTDNamedNodeMap.phpt
@@ -142,7 +142,11 @@ object(Dom\Entity)#3 (17) {
["textContent"]=>
NULL
}
-object(Dom\Notation)#4 (13) {
+object(Dom\Notation)#4 (15) {
+ ["publicId"]=>
+ string(0) ""
+ ["systemId"]=>
+ string(11) "viewgif.exe"
["nodeType"]=>
int(12)
["nodeName"]=>
diff --git a/ext/dom/tests/modern/xml/Notation_properties.phpt
b/ext/dom/tests/modern/xml/Notation_properties.phpt
new file mode 100644
index 000000000000..0a07c1c3e6a7
--- /dev/null
+++ b/ext/dom/tests/modern/xml/Notation_properties.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Dom\XMLDocument: Dom\Notation publicId and systemId properties
+--EXTENSIONS--
+dom
+--FILE--
+<?php
+$xml = <<<'XML'
+<!DOCTYPE r [
+ <!NOTATION image PUBLIC "-//Example//EN" "image.dat">
+ <!ELEMENT r EMPTY>
+]>
+<r/>
+XML;
+
+$doc = Dom\XMLDocument::createFromString($xml);
+$notation = $doc->doctype->notations->getNamedItem('image');
+
+var_dump($notation->publicId);
+var_dump($notation->systemId);
+?>
+--EXPECT--
+string(14) "-//Example//EN"
+string(9) "image.dat"