1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Extend C14N fast path to HTML documents too (#12293)

This commit is contained in:
Niels Dossche
2023-09-24 22:18:32 +02:00
committed by GitHub
parent 96a30882ca
commit 12790b2b35

View File

@@ -1798,7 +1798,8 @@ static void dom_canonicalization(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{
bool simple_node_parent_lookup_callback = false;
if (xpath_array == NULL) {
if (nodep->type != XML_DOCUMENT_NODE) {
/* Optimization: if the node is a document, all nodes may be included, no extra filtering or nodeset necessary. */
if (nodep->type != XML_DOCUMENT_NODE && nodep->type != XML_HTML_DOCUMENT_NODE) {
simple_node_parent_lookup_callback = true;
}
} else {