From: Rob Richards Date: Fri, 29 Aug 2003 15:29:24 +0000 (+0000) Subject: workaround for bug #25268. libxslt issue with xsl:key X-Git-Tag: php-4.3.4RC1~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c23ec177d5e16ca43ae69589a76b43500a66548a;p=php workaround for bug #25268. libxslt issue with xsl:key --- diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 1a17c63337..ada6127a9d 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -5349,7 +5349,7 @@ PHP_FUNCTION(domxml_xslt_process) xmlDocPtr xmldocp; xmlDocPtr docp; char **params = NULL; - int ret; + int ret, clone = 0; char *filename; int filename_len = 0; @@ -5361,7 +5361,7 @@ PHP_FUNCTION(domxml_xslt_process) RETURN_FALSE; } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|abs", &idxml, &idparams, &xpath_params, &filename, &filename_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o|a!b!s!l", &idxml, &idparams, &xpath_params, &filename, &filename_len, &clone) == FAILURE) { RETURN_FALSE; } @@ -5371,6 +5371,10 @@ PHP_FUNCTION(domxml_xslt_process) params = php_domxslt_make_params(idparams, xpath_params TSRMLS_CC); } + if (clone == 1) { + xmldocp = xmlCopyDoc(xmldocp, 1); + } + if (filename_len) { FILE *f; f = fopen (filename,"w"); @@ -5380,6 +5384,10 @@ PHP_FUNCTION(domxml_xslt_process) docp = xsltApplyStylesheet(xsltstp, xmldocp, (const char**)params); } + if (clone == 1) { + xmlFreeDoc(xmldocp); + } + if (params) { efree(params); }