mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
MFB: fix bug #39625 (Apache crashes on importStylesheet call)
This commit is contained in:
parent
65f8f45692
commit
5ccef7164e
@ -385,13 +385,15 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
|
||||
efree(member);
|
||||
if (clone_docu == 0) {
|
||||
/* check if the stylesheet is using xsl:key, if yes, we have to clone the document _always_ before a transformation */
|
||||
nodep = xmlDocGetRootElement(sheetp->doc)->children;
|
||||
while (nodep) {
|
||||
if (nodep->type == XML_ELEMENT_NODE && xmlStrEqual(nodep->name, "key") && xmlStrEqual(nodep->ns->href, XSLT_NAMESPACE)) {
|
||||
intern->hasKeys = 1;
|
||||
break;
|
||||
nodep = xmlDocGetRootElement(sheetp->doc);
|
||||
if (nodep && (nodep = nodep->children)) {
|
||||
while (nodep) {
|
||||
if (nodep->type == XML_ELEMENT_NODE && xmlStrEqual(nodep->name, "key") && xmlStrEqual(nodep->ns->href, XSLT_NAMESPACE)) {
|
||||
intern->hasKeys = 1;
|
||||
break;
|
||||
}
|
||||
nodep = nodep->next;
|
||||
}
|
||||
nodep = nodep->next;
|
||||
}
|
||||
} else {
|
||||
intern->hasKeys = clone_docu;
|
||||
|
Loading…
Reference in New Issue
Block a user