Skip to content

Commit 59f1622

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix missing deref in C14N (#14203)
2 parents 68089f0 + 1890d47 commit 59f1622

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
@@ -1874,6 +1874,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
18741874
inclusive_ns_prefixes = safe_emalloc(zend_hash_num_elements(Z_ARRVAL_P(ns_prefixes)) + 1,
18751875
sizeof(xmlChar *), 0);
18761876
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(ns_prefixes), tmpns) {
1877+
ZVAL_DEREF(tmpns);
18771878
if (Z_TYPE_P(tmpns) == IS_STRING) {
18781879
inclusive_ns_prefixes[nscount++] = (xmlChar *) Z_STRVAL_P(tmpns);
18791880
}

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)