mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix missing deref in C14N (#14203)
This commit is contained in:
commit
59f16223ae
2 changed files with 2 additions and 1 deletions
|
@ -1874,6 +1874,7 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
|
||||||
inclusive_ns_prefixes = safe_emalloc(zend_hash_num_elements(Z_ARRVAL_P(ns_prefixes)) + 1,
|
inclusive_ns_prefixes = safe_emalloc(zend_hash_num_elements(Z_ARRVAL_P(ns_prefixes)) + 1,
|
||||||
sizeof(xmlChar *), 0);
|
sizeof(xmlChar *), 0);
|
||||||
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(ns_prefixes), tmpns) {
|
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(ns_prefixes), tmpns) {
|
||||||
|
ZVAL_DEREF(tmpns);
|
||||||
if (Z_TYPE_P(tmpns) == IS_STRING) {
|
if (Z_TYPE_P(tmpns) == IS_STRING) {
|
||||||
inclusive_ns_prefixes[nscount++] = (xmlChar *) Z_STRVAL_P(tmpns);
|
inclusive_ns_prefixes[nscount++] = (xmlChar *) Z_STRVAL_P(tmpns);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,4 +38,4 @@ unset($v);
|
||||||
echo $doc->C14N(true, false, $xpath, $prefixes);
|
echo $doc->C14N(true, false, $xpath, $prefixes);
|
||||||
?>
|
?>
|
||||||
--EXPECT--
|
--EXPECT--
|
||||||
<contain xmlns="http://www.example.com/ns/foo"><bar></bar><bar></bar></contain>
|
<contain xmlns="http://www.example.com/ns/foo" xmlns:test="urn::test"><bar></bar><bar></bar></contain>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue