Skip to content

Commit de4c9c3

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix missing deref in C14N (#14203)
2 parents 19c8a10 + 59f1622 commit de4c9c3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ext/dom/node.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,6 +2184,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
21842184
inclusive_ns_prefixes = safe_emalloc(zend_hash_num_elements(Z_ARRVAL_P(ns_prefixes)) + 1,
21852185
sizeof(xmlChar *), 0);
21862186
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(ns_prefixes), tmpns) {
2187+
ZVAL_DEREF(tmpns);
21872188
if (Z_TYPE_P(tmpns) == IS_STRING) {
21882189
inclusive_ns_prefixes[nscount++] = BAD_CAST Z_STRVAL_P(tmpns);
21892190
}

ext/dom/tests/DOMNode_C14N_references.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ unset($v);
3838
echo $doc->C14N(true, false, $xpath, $prefixes);
3939
?>
4040
--EXPECT--
41-
<contain xmlns="http://www.example.com/ns/foo"><bar></bar><bar></bar></contain>
41+
<contain xmlns="http://www.example.com/ns/foo" xmlns:test="urn::test"><bar></bar><bar></bar></contain>

0 commit comments

Comments
 (0)