diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index ed300185eec1..76dbf9a3a3d7 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1249,7 +1249,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-- + + +]> + +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"