PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/xsl - xsltprocessor.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 320 427 74.9 %
Date: 2016-07-26 Functions: 16 18 88.9 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | PHP Version 7                                                        |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) 1997-2016 The PHP Group                                |
       6             :    +----------------------------------------------------------------------+
       7             :    | This source file is subject to version 3.01 of the PHP license,      |
       8             :    | that is bundled with this package in the file LICENSE, and is        |
       9             :    | available through the world-wide-web at the following url:           |
      10             :    | http://www.php.net/license/3_01.txt                                  |
      11             :    | If you did not receive a copy of the PHP license and are unable to   |
      12             :    | obtain it through the world-wide-web, please send a note to          |
      13             :    | license@php.net so we can mail you a copy immediately.               |
      14             :    +----------------------------------------------------------------------+
      15             :    | Authors: Christian Stocker <chregu@php.net>                          |
      16             :    |          Rob Richards <rrichards@php.net>                            |
      17             :    +----------------------------------------------------------------------+
      18             : */
      19             : 
      20             : /* $Id$ */
      21             : 
      22             : #ifdef HAVE_CONFIG_H
      23             : #include "config.h"
      24             : #endif
      25             : 
      26             : #include "php.h"
      27             : #include "php_xsl.h"
      28             : #include "ext/libxml/php_libxml.h"
      29             : 
      30             : /* {{{ arginfo */
      31             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_import_stylesheet, 0, 0, 1)
      32             :         ZEND_ARG_INFO(0, doc)
      33             : ZEND_END_ARG_INFO();
      34             : 
      35             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_doc, 0, 0, 1)
      36             :         ZEND_ARG_INFO(0, doc)
      37             : ZEND_END_ARG_INFO();
      38             : 
      39             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_uri, 0, 0, 2)
      40             :         ZEND_ARG_INFO(0, doc)
      41             :         ZEND_ARG_INFO(0, uri)
      42             : ZEND_END_ARG_INFO();
      43             : 
      44             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_transform_to_xml, 0, 0, 1)
      45             :         ZEND_ARG_INFO(0, doc)
      46             : ZEND_END_ARG_INFO();
      47             : 
      48             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_set_parameter, 0, 0, 2)
      49             :         ZEND_ARG_INFO(0, namespace)
      50             :         ZEND_ARG_INFO(0, name)
      51             :         ZEND_ARG_INFO(0, value)
      52             : ZEND_END_ARG_INFO();
      53             : 
      54             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_get_parameter, 0, 0, 2)
      55             :         ZEND_ARG_INFO(0, namespace)
      56             :         ZEND_ARG_INFO(0, name)
      57             : ZEND_END_ARG_INFO();
      58             : 
      59             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_remove_parameter, 0, 0, 2)
      60             :         ZEND_ARG_INFO(0, namespace)
      61             :         ZEND_ARG_INFO(0, name)
      62             : ZEND_END_ARG_INFO();
      63             : 
      64             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_has_exslt_support, 0, 0, 0)
      65             : ZEND_END_ARG_INFO();
      66             : 
      67             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_register_php_functions, 0, 0, 0)
      68             :         ZEND_ARG_INFO(0, restrict)
      69             : ZEND_END_ARG_INFO();
      70             : 
      71             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_set_profiling, 0, 0, 1)
      72             :         ZEND_ARG_INFO(0, filename)
      73             : ZEND_END_ARG_INFO();
      74             : 
      75             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_set_security_prefs, 0, 0, 1)
      76             :         ZEND_ARG_INFO(0, securityPrefs)
      77             : ZEND_END_ARG_INFO();
      78             : 
      79             : ZEND_BEGIN_ARG_INFO_EX(arginfo_xsl_xsltprocessor_get_security_prefs, 0, 0, 0)
      80             : ZEND_END_ARG_INFO();
      81             : /* }}} */
      82             : 
      83             : /*
      84             : * class xsl_xsltprocessor
      85             : *
      86             : * URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#
      87             : * Since:
      88             : */
      89             : 
      90             : const zend_function_entry php_xsl_xsltprocessor_class_functions[] = {
      91             :         PHP_FALIAS(importStylesheet, xsl_xsltprocessor_import_stylesheet, arginfo_xsl_xsltprocessor_import_stylesheet)
      92             :         PHP_FALIAS(transformToDoc, xsl_xsltprocessor_transform_to_doc, arginfo_xsl_xsltprocessor_transform_to_doc)
      93             :         PHP_FALIAS(transformToUri, xsl_xsltprocessor_transform_to_uri, arginfo_xsl_xsltprocessor_transform_to_uri)
      94             :         PHP_FALIAS(transformToXml, xsl_xsltprocessor_transform_to_xml, arginfo_xsl_xsltprocessor_transform_to_xml)
      95             :         PHP_FALIAS(setParameter, xsl_xsltprocessor_set_parameter, arginfo_xsl_xsltprocessor_set_parameter)
      96             :         PHP_FALIAS(getParameter, xsl_xsltprocessor_get_parameter, arginfo_xsl_xsltprocessor_get_parameter)
      97             :         PHP_FALIAS(removeParameter, xsl_xsltprocessor_remove_parameter, arginfo_xsl_xsltprocessor_remove_parameter)
      98             :         PHP_FALIAS(hasExsltSupport, xsl_xsltprocessor_has_exslt_support, arginfo_xsl_xsltprocessor_has_exslt_support)
      99             :         PHP_FALIAS(registerPHPFunctions, xsl_xsltprocessor_register_php_functions, arginfo_xsl_xsltprocessor_register_php_functions)
     100             :         PHP_FALIAS(setProfiling, xsl_xsltprocessor_set_profiling, arginfo_xsl_xsltprocessor_set_profiling)
     101             :         PHP_FALIAS(setSecurityPrefs, xsl_xsltprocessor_set_security_prefs, arginfo_xsl_xsltprocessor_set_security_prefs)
     102             :         PHP_FALIAS(getSecurityPrefs, xsl_xsltprocessor_get_security_prefs, arginfo_xsl_xsltprocessor_get_security_prefs)
     103             :         PHP_FE_END
     104             : };
     105             : 
     106             : /* {{{ php_xsl_xslt_string_to_xpathexpr()
     107             :    Translates a string to a XPath Expression */
     108           5 : static char *php_xsl_xslt_string_to_xpathexpr(const char *str)
     109             : {
     110           5 :         const xmlChar *string = (const xmlChar *)str;
     111             : 
     112             :         xmlChar *value;
     113             :         int str_len;
     114             : 
     115           5 :         str_len = xmlStrlen(string) + 3;
     116             : 
     117           5 :         if (xmlStrchr(string, '"')) {
     118           2 :                 if (xmlStrchr(string, '\'')) {
     119           2 :                         php_error_docref(NULL, E_WARNING, "Cannot create XPath expression (string contains both quote and double-quotes)");
     120           2 :                         return NULL;
     121             :                 }
     122           0 :                 value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0);
     123           0 :                 snprintf((char*)value, str_len, "'%s'", string);
     124             :         } else {
     125           3 :                 value = (xmlChar*) safe_emalloc (str_len, sizeof(xmlChar), 0);
     126           3 :                 snprintf((char *)value, str_len, "\"%s\"", string);
     127             :         }
     128           3 :         return (char *) value;
     129             : }
     130             : /* }}} */
     131             : 
     132             : /* {{{ php_xsl_xslt_make_params()
     133             :    Translates a PHP array to a libxslt parameters array */
     134          50 : static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params)
     135             : {
     136             : 
     137             :         int parsize;
     138             :         zval *value;
     139             :         char *xpath_expr;
     140             :         zend_string *string_key;
     141          50 :         char **params = NULL;
     142          50 :         int i = 0;
     143             : 
     144          50 :         parsize = (2 * zend_hash_num_elements(parht) + 1) * sizeof(char *);
     145          50 :         params = (char **)safe_emalloc((2 * zend_hash_num_elements(parht) + 1), sizeof(char *), 0);
     146          50 :         memset((char *)params, 0, parsize);
     147             : 
     148          60 :         ZEND_HASH_FOREACH_STR_KEY_VAL(parht, string_key, value) {
     149           5 :                 if (string_key == NULL) {
     150           0 :                         php_error_docref(NULL, E_WARNING, "Invalid argument or parameter array");
     151           0 :                         efree(params);
     152           0 :                         return NULL;
     153             :                 } else {
     154           5 :                         if (Z_TYPE_P(value) != IS_STRING) {
     155           0 :                                 convert_to_string(value);
     156             :                         }
     157             : 
     158           5 :                         if (!xpath_params) {
     159           5 :                                 xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_P(value));
     160             :                         } else {
     161           0 :                                 xpath_expr = estrndup(Z_STRVAL_P(value), Z_STRLEN_P(value));
     162             :                         }
     163           5 :                         if (xpath_expr) {
     164           3 :                                 params[i++] = estrndup(ZSTR_VAL(string_key), ZSTR_LEN(string_key));
     165           3 :                                 params[i++] = xpath_expr;
     166             :                         }
     167             :                 }
     168             :         } ZEND_HASH_FOREACH_END();
     169             : 
     170          50 :         params[i++] = NULL;
     171             : 
     172          50 :         return params;
     173             : }
     174             : /* }}} */
     175             : 
     176          31 : static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int type) /* {{{ */
     177             : {
     178             :         xsltTransformContextPtr tctxt;
     179             :         zval *args;
     180             :         zval retval;
     181             :         int result, i;
     182          31 :         int error = 0;
     183             :         zend_fcall_info fci;
     184             :         zval handler;
     185             :         xmlXPathObjectPtr obj;
     186             :         char *str;
     187             :         xsl_object *intern;
     188          31 :         zend_string *callable = NULL;
     189             : 
     190             : 
     191          31 :         if (! zend_is_executing()) {
     192           0 :                 xsltGenericError(xsltGenericErrorContext,
     193             :                 "xsltExtFunctionTest: Function called from outside of PHP\n");
     194           0 :                 error = 1;
     195             :         } else {
     196          31 :                 tctxt = xsltXPathGetTransformContext(ctxt);
     197          31 :                 if (tctxt == NULL) {
     198           0 :                         xsltGenericError(xsltGenericErrorContext,
     199             :                         "xsltExtFunctionTest: failed to get the transformation context\n");
     200           0 :                         error = 1;
     201             :                 } else {
     202          31 :                         intern = (xsl_object*)tctxt->_private;
     203          31 :                         if (intern == NULL) {
     204           0 :                                 xsltGenericError(xsltGenericErrorContext,
     205             :                                 "xsltExtFunctionTest: failed to get the internal object\n");
     206           0 :                                 error = 1;
     207             :                         }
     208          31 :                         else if (intern->registerPhpFunctions == 0) {
     209           0 :                                 xsltGenericError(xsltGenericErrorContext,
     210             :                                 "xsltExtFunctionTest: PHP Object did not register PHP functions\n");
     211           0 :                                 error = 1;
     212             :                         }
     213             :                 }
     214             :         }
     215             : 
     216          31 :         if (error == 1) {
     217           0 :                 for (i = nargs - 1; i >= 0; i--) {
     218           0 :                         obj = valuePop(ctxt);
     219           0 :                         if (obj) {
     220           0 :                                 xmlXPathFreeObject(obj);
     221             :                         }
     222             :                 }
     223           0 :                 return;
     224             :         }
     225             : 
     226          31 :         fci.param_count = nargs - 1;
     227          31 :         if (fci.param_count > 0) {
     228          28 :                 args = safe_emalloc(fci.param_count, sizeof(zval), 0);
     229             :         }
     230             :         /* Reverse order to pop values off ctxt stack */
     231          61 :         for (i = nargs - 2; i >= 0; i--) {
     232          30 :                 obj = valuePop(ctxt);
     233          30 :                 if (obj == NULL) {
     234           1 :                         ZVAL_NULL(&args[i]);
     235           1 :                         continue;
     236             :                 }
     237          29 :                 switch (obj->type) {
     238             :                         case XPATH_STRING:
     239          30 :                                 ZVAL_STRING(&args[i], (char *)obj->stringval);
     240          15 :                                 break;
     241             :                         case XPATH_BOOLEAN:
     242           0 :                                 ZVAL_BOOL(&args[i],  obj->boolval);
     243           0 :                                 break;
     244             :                         case XPATH_NUMBER:
     245           0 :                                 ZVAL_DOUBLE(&args[i], obj->floatval);
     246           0 :                                 break;
     247             :                         case XPATH_NODESET:
     248          14 :                                 if (type == 1) {
     249           1 :                                         str = (char*)xmlXPathCastToString(obj);
     250           2 :                                         ZVAL_STRING(&args[i], str);
     251           1 :                                         xmlFree(str);
     252          13 :                                 } else if (type == 2) {
     253             :                                         int j;
     254          13 :                                         dom_object *domintern = (dom_object *)intern->doc;
     255          13 :                                         array_init(&args[i]);
     256          13 :                                         if (obj->nodesetval && obj->nodesetval->nodeNr > 0) {
     257          24 :                                                 for (j = 0; j < obj->nodesetval->nodeNr; j++) {
     258          12 :                                                         xmlNodePtr node = obj->nodesetval->nodeTab[j];
     259             :                                                         zval child;
     260             :                                                         /* not sure, if we need this... it's copied from xpath.c */
     261          12 :                                                         if (node->type == XML_NAMESPACE_DECL) {
     262             :                                                                 xmlNsPtr curns;
     263             :                                                                 xmlNodePtr nsparent;
     264             : 
     265           0 :                                                                 nsparent = node->_private;
     266           0 :                                                                 curns = xmlNewNs(NULL, node->name, NULL);
     267           0 :                                                                 if (node->children) {
     268           0 :                                                                         curns->prefix = xmlStrdup((xmlChar *)node->children);
     269             :                                                                 }
     270           0 :                                                                 if (node->children) {
     271           0 :                                                                         node = xmlNewDocNode(node->doc, NULL, (xmlChar *) node->children, node->name);
     272             :                                                                 } else {
     273           0 :                                                                         node = xmlNewDocNode(node->doc, NULL, (const xmlChar *) "xmlns", node->name);
     274             :                                                                 }
     275           0 :                                                                 node->type = XML_NAMESPACE_DECL;
     276           0 :                                                                 node->parent = nsparent;
     277           0 :                                                                 node->ns = curns;
     278             :                                                         } else {
     279          12 :                                                                 node = xmlDocCopyNodeList(domintern->document->ptr, node);
     280             :                                                         }
     281             : 
     282          12 :                                                         php_dom_create_object(node, &child, domintern);
     283          12 :                                                         add_next_index_zval(&args[i], &child);
     284             :                                                 }
     285             :                                         }
     286             :                                 }
     287          14 :                                 break;
     288             :                         default:
     289           0 :                                 str = (char *) xmlXPathCastToString(obj);
     290           0 :                                 ZVAL_STRING(&args[i], str);
     291           0 :                                 xmlFree(str);
     292             :                 }
     293          29 :                 xmlXPathFreeObject(obj);
     294             :         }
     295             : 
     296          31 :         fci.size = sizeof(fci);
     297          31 :         if (fci.param_count > 0) {
     298          28 :                 fci.params = args;
     299             :         } else {
     300           3 :                 fci.params = NULL;
     301             :         }
     302             : 
     303             : 
     304          31 :         obj = valuePop(ctxt);
     305          31 :         if (obj == NULL || obj->stringval == NULL) {
     306           2 :                 php_error_docref(NULL, E_WARNING, "Handler name must be a string");
     307           2 :                 xmlXPathFreeObject(obj);
     308           2 :                 valuePush(ctxt, xmlXPathNewString((const xmlChar *) ""));
     309           2 :                 if (fci.param_count > 0) {
     310           5 :                         for (i = 0; i < nargs - 1; i++) {
     311           3 :                                 zval_ptr_dtor(&args[i]);
     312             :                         }
     313           2 :                         efree(args);
     314             :                 }
     315           2 :                 return;
     316             :         }
     317          58 :         ZVAL_STRING(&handler, (char *) obj->stringval);
     318          29 :         xmlXPathFreeObject(obj);
     319             : 
     320          29 :         ZVAL_COPY_VALUE(&fci.function_name, &handler);
     321          29 :         fci.object = NULL;
     322          29 :         fci.retval = &retval;
     323          29 :         fci.no_separation = 0;
     324             :         /*fci.function_handler_cache = &function_ptr;*/
     325          29 :         if (!zend_make_callable(&handler, &callable)) {
     326           1 :                 php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", ZSTR_VAL(callable));
     327           1 :                 valuePush(ctxt, xmlXPathNewString((const xmlChar *) ""));
     328          29 :         } else if ( intern->registerPhpFunctions == 2 && zend_hash_exists(intern->registered_phpfunctions, callable) == 0) {
     329           2 :                 php_error_docref(NULL, E_WARNING, "Not allowed to call handler '%s()'", ZSTR_VAL(callable));
     330             :                 /* Push an empty string, so that we at least have an xslt result... */
     331           2 :                 valuePush(ctxt, xmlXPathNewString((const xmlChar *) ""));
     332             :         } else {
     333          25 :                 result = zend_call_function(&fci, NULL);
     334          25 :                 if (result == FAILURE) {
     335           0 :                         if (Z_TYPE(handler) == IS_STRING) {
     336           0 :                                 php_error_docref(NULL, E_WARNING, "Unable to call handler %s()", Z_STRVAL(handler));
     337           0 :                                 valuePush(ctxt, xmlXPathNewString((const xmlChar *) ""));
     338             :                         }
     339             :                 /* retval is == NULL, when an exception occurred, don't report anything, because PHP itself will handle that */
     340          25 :                 } else if (Z_ISUNDEF(retval)) {
     341             :                 } else {
     342          17 :                         if (Z_TYPE(retval) == IS_OBJECT && instanceof_function(Z_OBJCE(retval), dom_node_class_entry)) {
     343             :                                 xmlNode *nodep;
     344             :                                 dom_object *obj;
     345           2 :                                 if (intern->node_list == NULL) {
     346           1 :                                         ALLOC_HASHTABLE(intern->node_list);
     347           1 :                                         zend_hash_init(intern->node_list, 0, NULL, ZVAL_PTR_DTOR, 0);
     348             :                                 }
     349             :                                 Z_ADDREF(retval);
     350           2 :                                 zend_hash_next_index_insert(intern->node_list, &retval);
     351           2 :                                 obj = Z_DOMOBJ_P(&retval);
     352           2 :                                 nodep = dom_object_get_node(obj);
     353           2 :                                 valuePush(ctxt, xmlXPathNewNodeSet(nodep));
     354          26 :                         } else if (Z_TYPE(retval) == IS_TRUE || Z_TYPE(retval) == IS_FALSE) {
     355           0 :                                 valuePush(ctxt, xmlXPathNewBoolean(Z_TYPE(retval) == IS_TRUE));
     356          13 :                         } else if (Z_TYPE(retval) == IS_OBJECT) {
     357           1 :                                 php_error_docref(NULL, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
     358           1 :                                 valuePush(ctxt, xmlXPathNewString((const xmlChar *) ""));
     359             :                         } else {
     360          12 :                                 convert_to_string_ex(&retval);
     361          12 :                                 valuePush(ctxt, xmlXPathNewString((xmlChar *) Z_STRVAL(retval)));
     362             :                         }
     363          15 :                         zval_ptr_dtor(&retval);
     364             :                 }
     365             :         }
     366          28 :         zend_string_release(callable);
     367          28 :         zval_ptr_dtor(&handler);
     368          28 :         if (fci.param_count > 0) {
     369          53 :                 for (i = 0; i < nargs - 1; i++) {
     370          27 :                         zval_ptr_dtor(&args[i]);
     371             :                 }
     372          26 :                 efree(args);
     373             :         }
     374             : }
     375             : /* }}} */
     376             : 
     377           1 : void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs) /* {{{ */
     378             : {
     379           1 :         xsl_ext_function_php(ctxt, nargs, 1);
     380           1 : }
     381             : /* }}} */
     382             : 
     383          30 : void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs) /* {{{ */
     384             : {
     385          30 :         xsl_ext_function_php(ctxt, nargs, 2);
     386          29 : }
     387             : /* }}} */
     388             : 
     389             : /* {{{ proto void xsl_xsltprocessor_import_stylesheet(domdocument doc)
     390             : URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#
     391             : Since:
     392             : */
     393          64 : PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
     394             : {
     395          64 :         zval *id, *docp = NULL;
     396          64 :         xmlDoc *doc = NULL, *newdoc = NULL;
     397             :         xsltStylesheetPtr sheetp, oldsheetp;
     398             :         xsl_object *intern;
     399          64 :         int prevSubstValue, prevExtDtdValue, clone_docu = 0;
     400          64 :         xmlNode *nodep = NULL;
     401             :         zend_object_handlers *std_hnd;
     402             :         zval *cloneDocu, member, rv;
     403             : 
     404         128 :         if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Oo", &id, xsl_xsltprocessor_class_entry, &docp) == FAILURE) {
     405           0 :                 RETURN_FALSE;
     406             :         }
     407             : 
     408          64 :         nodep = php_libxml_import_node(docp);
     409             : 
     410          64 :         if (nodep) {
     411          64 :                 doc = nodep->doc;
     412             :         }
     413          64 :         if (doc == NULL) {
     414           0 :                 php_error(E_WARNING, "Invalid Document");
     415           0 :                 RETURN_FALSE;
     416             :         }
     417             : 
     418             :         /* libxslt uses _private, so we must copy the imported
     419             :         stylesheet document otherwise the node proxies will be a mess */
     420          64 :         newdoc = xmlCopyDoc(doc, 1);
     421          64 :         xmlNodeSetBase((xmlNodePtr) newdoc, (xmlChar *)doc->URL);
     422          64 :         prevSubstValue = xmlSubstituteEntitiesDefault(1);
     423          64 :         prevExtDtdValue = xmlLoadExtDtdDefaultValue;
     424          64 :         xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
     425             : 
     426          64 :         sheetp = xsltParseStylesheetDoc(newdoc);
     427          64 :         xmlSubstituteEntitiesDefault(prevSubstValue);
     428          64 :         xmlLoadExtDtdDefaultValue = prevExtDtdValue;
     429             : 
     430          64 :         if (!sheetp) {
     431           0 :                 xmlFreeDoc(newdoc);
     432           0 :                 RETURN_FALSE;
     433             :         }
     434             : 
     435          64 :         intern = Z_XSL_P(id);
     436             : 
     437          64 :         std_hnd = zend_get_std_object_handlers();
     438         128 :         ZVAL_STRING(&member, "cloneDocument");
     439          64 :         cloneDocu = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv);
     440          64 :         if (Z_TYPE_P(cloneDocu) != IS_NULL) {
     441           0 :                 convert_to_long(cloneDocu);
     442           0 :                 clone_docu = Z_LVAL_P(cloneDocu);
     443             :         }
     444          64 :         zval_ptr_dtor(&member);
     445          64 :         if (clone_docu == 0) {
     446             :                 /* check if the stylesheet is using xsl:key, if yes, we have to clone the document _always_ before a transformation */
     447          64 :                 nodep = xmlDocGetRootElement(sheetp->doc);
     448          64 :                 if (nodep && (nodep = nodep->children)) {
     449         281 :                         while (nodep) {
     450         154 :                                 if (nodep->type == XML_ELEMENT_NODE && xmlStrEqual(nodep->name, (const xmlChar *) "key") && xmlStrEqual(nodep->ns->href, XSLT_NAMESPACE)) {
     451           1 :                                         intern->hasKeys = 1;
     452           1 :                                         break;
     453             :                                 }
     454         153 :                                 nodep = nodep->next;
     455             :                         }
     456             :                 }
     457             :         } else {
     458           0 :                 intern->hasKeys = clone_docu;
     459             :         }
     460             : 
     461          64 :         if ((oldsheetp = (xsltStylesheetPtr)intern->ptr)) {
     462             :                 /* free wrapper */
     463           0 :                 if (((xsltStylesheetPtr) intern->ptr)->_private != NULL) {
     464           0 :                         ((xsltStylesheetPtr) intern->ptr)->_private = NULL;
     465             :                 }
     466           0 :                 xsltFreeStylesheet((xsltStylesheetPtr) intern->ptr);
     467           0 :                 intern->ptr = NULL;
     468             :         }
     469             : 
     470          64 :         php_xsl_set_object(id, sheetp);
     471          64 :         RETVAL_TRUE;
     472             : }
     473             : /* }}} end xsl_xsltprocessor_import_stylesheet */
     474             : 
     475          50 : static xmlDocPtr php_xsl_apply_stylesheet(zval *id, xsl_object *intern, xsltStylesheetPtr style, zval *docp) /* {{{ */
     476             : {
     477          50 :         xmlDocPtr newdocp = NULL;
     478          50 :         xmlDocPtr doc = NULL;
     479          50 :         xmlNodePtr node = NULL;
     480             :         xsltTransformContextPtr ctxt;
     481             :         php_libxml_node_object *object;
     482          50 :         char **params = NULL;
     483             :         int clone;
     484             :         zval *doXInclude, member, rv;
     485             :         zend_object_handlers *std_hnd;
     486             :         FILE *f;
     487          50 :         int secPrefsError = 0;
     488             :         int secPrefsValue;
     489          50 :         xsltSecurityPrefsPtr secPrefs = NULL;
     490             : 
     491          50 :         node = php_libxml_import_node(docp);
     492             : 
     493          50 :         if (node) {
     494          50 :                 doc = node->doc;
     495             :         }
     496          50 :         if (doc == NULL) {
     497           0 :                 php_error_docref(NULL, E_WARNING, "Invalid Document");
     498           0 :                 return NULL;
     499             :         }
     500             : 
     501          50 :         if (style == NULL) {
     502           0 :                 php_error_docref(NULL, E_WARNING, "No stylesheet associated to this object");
     503           0 :                 return NULL;
     504             :         }
     505             : 
     506          50 :         if (intern->profiling) {
     507           0 :                 if (php_check_open_basedir(intern->profiling)) {
     508           0 :                         f = NULL;
     509             :                 } else {
     510           0 :                         f = VCWD_FOPEN(intern->profiling, "w");
     511             :                 }
     512             :         } else {
     513          50 :                 f = NULL;
     514             :         }
     515             : 
     516          50 :         if (intern->parameter) {
     517          50 :                 params = php_xsl_xslt_make_params(intern->parameter, 0);
     518             :         }
     519             : 
     520          50 :         intern->doc = emalloc(sizeof(php_libxml_node_object));
     521          50 :         memset(intern->doc, 0, sizeof(php_libxml_node_object));
     522             : 
     523          50 :         if (intern->hasKeys == 1) {
     524           1 :                 doc = xmlCopyDoc(doc, 1);
     525             :         } else {
     526          49 :                 object = Z_LIBXML_NODE_P(docp);
     527          49 :                 intern->doc->document = object->document;
     528             :         }
     529             : 
     530          50 :         php_libxml_increment_doc_ref(intern->doc, doc);
     531             : 
     532          50 :         ctxt = xsltNewTransformContext(style, doc);
     533          50 :         ctxt->_private = (void *) intern;
     534             : 
     535          50 :         std_hnd = zend_get_std_object_handlers();
     536             : 
     537         100 :         ZVAL_STRING(&member, "doXInclude");
     538          50 :         doXInclude = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv);
     539          50 :         if (Z_TYPE_P(doXInclude) != IS_NULL) {
     540           0 :                 convert_to_long(doXInclude);
     541           0 :                 ctxt->xinclude = Z_LVAL_P(doXInclude);
     542             :         }
     543          50 :         zval_ptr_dtor(&member);
     544             : 
     545          50 :         secPrefsValue = intern->securityPrefs;
     546             : 
     547             :         /* if securityPrefs is set to NONE, we don't have to do any checks, but otherwise... */
     548          50 :         if (secPrefsValue != XSL_SECPREF_NONE) {
     549          48 :                 secPrefs = xsltNewSecurityPrefs();
     550          48 :                 if (secPrefsValue & XSL_SECPREF_READ_FILE ) {
     551           0 :                         if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_READ_FILE, xsltSecurityForbid)) {
     552           0 :                                 secPrefsError = 1;
     553             :                         }
     554             :                 }
     555          48 :                 if (secPrefsValue & XSL_SECPREF_WRITE_FILE ) {
     556          48 :                         if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_WRITE_FILE, xsltSecurityForbid)) {
     557           0 :                                 secPrefsError = 1;
     558             :                         }
     559             :                 }
     560          48 :                 if (secPrefsValue & XSL_SECPREF_CREATE_DIRECTORY ) {
     561          48 :                         if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_CREATE_DIRECTORY, xsltSecurityForbid)) {
     562           0 :                                 secPrefsError = 1;
     563             :                         }
     564             :                 }
     565          48 :                 if (secPrefsValue & XSL_SECPREF_READ_NETWORK) {
     566           0 :                         if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_READ_NETWORK, xsltSecurityForbid)) {
     567           0 :                                 secPrefsError = 1;
     568             :                         }
     569             :                 }
     570          48 :                 if (secPrefsValue & XSL_SECPREF_WRITE_NETWORK) {
     571          48 :                         if (0 != xsltSetSecurityPrefs(secPrefs, XSLT_SECPREF_WRITE_NETWORK, xsltSecurityForbid)) {
     572           0 :                                 secPrefsError = 1;
     573             :                         }
     574             :                 }
     575             : 
     576          48 :                 if (0 != xsltSetCtxtSecurityPrefs(secPrefs, ctxt)) {
     577           0 :                         secPrefsError = 1;
     578             :                 }
     579             :         }
     580             : 
     581          50 :         if (secPrefsError == 1) {
     582           0 :                 php_error_docref(NULL, E_WARNING, "Can't set libxslt security properties, not doing transformation for security reasons");
     583             :         } else {
     584          50 :                 newdocp = xsltApplyStylesheetUser(style, doc, (const char**) params,  NULL, f, ctxt);
     585             :         }
     586          49 :         if (f) {
     587           0 :                 fclose(f);
     588             :         }
     589             : 
     590          49 :         xsltFreeTransformContext(ctxt);
     591          49 :         if (secPrefs) {
     592          47 :                 xsltFreeSecurityPrefs(secPrefs);
     593             :         }
     594             : 
     595          49 :         if (intern->node_list != NULL) {
     596           1 :                 zend_hash_destroy(intern->node_list);
     597           1 :                 FREE_HASHTABLE(intern->node_list);
     598           1 :                 intern->node_list = NULL;
     599             :         }
     600             : 
     601          49 :         php_libxml_decrement_doc_ref(intern->doc);
     602          49 :         efree(intern->doc);
     603          49 :         intern->doc = NULL;
     604             : 
     605          49 :         if (params) {
     606          49 :                 clone = 0;
     607         104 :                 while(params[clone]) {
     608           6 :                         efree(params[clone++]);
     609             :                 }
     610          49 :                 efree(params);
     611             :         }
     612             : 
     613          49 :         return newdocp;
     614             : 
     615             : }
     616             : /* }}} */
     617             : 
     618             : /* {{{ proto domdocument xsl_xsltprocessor_transform_to_doc(domnode doc)
     619             : URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#
     620             : Since:
     621             : */
     622          18 : PHP_FUNCTION(xsl_xsltprocessor_transform_to_doc)
     623             : {
     624          18 :         zval *id, *docp = NULL;
     625             :         xmlDoc *newdocp;
     626             :         xsltStylesheetPtr sheetp;
     627          18 :         zend_string *ret_class = NULL;
     628             :         xsl_object *intern;
     629             : 
     630          36 :         id = getThis();
     631          18 :         intern = Z_XSL_P(id);
     632          18 :         sheetp = (xsltStylesheetPtr) intern->ptr;
     633             : 
     634          18 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "o|S!", &docp, &ret_class) == FAILURE) {
     635           5 :                 RETURN_FALSE;
     636             :         }
     637             : 
     638          13 :         newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp);
     639             : 
     640          12 :         if (newdocp) {
     641          12 :                 if (ret_class) {
     642             :                         zend_string *curclass_name;
     643             :                         zend_class_entry *curce, *ce;
     644             :                         php_libxml_node_object *interndoc;
     645             : 
     646           0 :                         curce = Z_OBJCE_P(docp);
     647           0 :                         curclass_name = curce->name;
     648           0 :                         while (curce->parent != NULL) {
     649           0 :                                 curce = curce->parent;
     650             :                         }
     651             : 
     652           0 :                         ce = zend_lookup_class(ret_class);
     653           0 :                         if (ce == NULL || !instanceof_function(ce, curce)) {
     654           0 :                                 xmlFreeDoc(newdocp);
     655           0 :                                 php_error_docref(NULL, E_WARNING,
     656           0 :                                         "Expecting class compatible with %s, '%s' given", ZSTR_VAL(curclass_name), ZSTR_VAL(ret_class));
     657           0 :                                 RETURN_FALSE;
     658             :                         }
     659             : 
     660           0 :                         object_init_ex(return_value, ce);
     661             : 
     662           0 :                         interndoc = Z_LIBXML_NODE_P(return_value);
     663           0 :                         php_libxml_increment_doc_ref(interndoc, newdocp);
     664           0 :                         php_libxml_increment_node_ptr(interndoc, (xmlNodePtr)newdocp, (void *)interndoc);
     665             :                 } else {
     666          12 :                         php_dom_create_object((xmlNodePtr) newdocp, return_value, NULL);
     667             :                 }
     668             :         } else {
     669           0 :                 RETURN_FALSE;
     670             :         }
     671             : 
     672             : }
     673             : /* }}} end xsl_xsltprocessor_transform_to_doc */
     674             : 
     675             : /* {{{ proto int xsl_xsltprocessor_transform_to_uri(domdocument doc, string uri)
     676             : */
     677           7 : PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri)
     678             : {
     679           7 :         zval *id, *docp = NULL;
     680             :         xmlDoc *newdocp;
     681             :         xsltStylesheetPtr sheetp;
     682             :         int ret;
     683             :         size_t uri_len;
     684             :         char *uri;
     685             :         xsl_object *intern;
     686             : 
     687          14 :         id = getThis();
     688           7 :         intern = Z_XSL_P(id);
     689           7 :         sheetp = (xsltStylesheetPtr) intern->ptr;
     690             : 
     691           7 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "op", &docp, &uri, &uri_len) == FAILURE) {
     692           5 :                 RETURN_FALSE;
     693             :         }
     694             : 
     695           2 :         newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp);
     696             : 
     697           2 :         ret = -1;
     698           2 :         if (newdocp) {
     699           2 :                 ret = xsltSaveResultToFilename(uri, newdocp, sheetp, 0);
     700           2 :                 xmlFreeDoc(newdocp);
     701             :         }
     702             : 
     703           2 :         RETVAL_LONG(ret);
     704             : }
     705             : /* }}} end xsl_xsltprocessor_transform_to_uri */
     706             : 
     707             : /* {{{ proto string xsl_xsltprocessor_transform_to_xml(domdocument doc)
     708             : */
     709          40 : PHP_FUNCTION(xsl_xsltprocessor_transform_to_xml)
     710             : {
     711          40 :         zval *id, *docp = NULL;
     712             :         xmlDoc *newdocp;
     713             :         xsltStylesheetPtr sheetp;
     714             :         int ret;
     715             :         xmlChar *doc_txt_ptr;
     716             :         int doc_txt_len;
     717             :         xsl_object *intern;
     718             : 
     719          80 :         id = getThis();
     720          40 :         intern = Z_XSL_P(id);
     721          40 :         sheetp = (xsltStylesheetPtr) intern->ptr;
     722             : 
     723          40 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &docp) == FAILURE) {
     724           5 :                 RETURN_FALSE;
     725             :         }
     726             : 
     727          35 :         newdocp = php_xsl_apply_stylesheet(id, intern, sheetp, docp);
     728             : 
     729          35 :         ret = -1;
     730          35 :         if (newdocp) {
     731          31 :                 ret = xsltSaveResultToString(&doc_txt_ptr, &doc_txt_len, newdocp, sheetp);
     732          31 :                 if (doc_txt_ptr && doc_txt_len) {
     733          50 :                         RETVAL_STRINGL((char *) doc_txt_ptr, doc_txt_len);
     734          25 :                         xmlFree(doc_txt_ptr);
     735             :                 }
     736          31 :                 xmlFreeDoc(newdocp);
     737             :         }
     738             : 
     739          35 :         if (ret < 0) {
     740           4 :                 RETURN_FALSE;
     741             :         }
     742             : }
     743             : /* }}} end xsl_xsltprocessor_transform_to_xml */
     744             : 
     745             : /* {{{ proto bool xsl_xsltprocessor_set_parameter(string namespace, mixed name [, string value])
     746             : */
     747           7 : PHP_FUNCTION(xsl_xsltprocessor_set_parameter)
     748             : {
     749             : 
     750             :         zval *id;
     751             :         zval *array_value, *entry, new_string;
     752             :         xsl_object *intern;
     753             :         char *namespace;
     754             :         size_t namespace_len;
     755             :         zend_string *string_key, *name, *value;
     756          14 :         DOM_GET_THIS(id);
     757             : 
     758           7 :         if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sa", &namespace, &namespace_len, &array_value) == SUCCESS) {
     759           2 :                 intern = Z_XSL_P(id);
     760           7 :                 ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(array_value), string_key, entry) {
     761           3 :                         if (string_key == NULL) {
     762           1 :                                 php_error_docref(NULL, E_WARNING, "Invalid parameter array");
     763           1 :                                 RETURN_FALSE;
     764             :                         }
     765           2 :                         convert_to_string_ex(entry);
     766           2 :                         if (Z_REFCOUNTED_P(entry)) {
     767             :                                 Z_ADDREF_P(entry);
     768             :                         }
     769           2 :                         zend_hash_update(intern->parameter, string_key, entry);
     770             :                 } ZEND_HASH_FOREACH_END();
     771           1 :                 RETURN_TRUE;
     772           5 :         } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "sSS", &namespace, &namespace_len, &name, &value) == SUCCESS) {
     773             : 
     774           5 :                 intern = Z_XSL_P(id);
     775             : 
     776           5 :                 ZVAL_STR_COPY(&new_string, value);
     777             : 
     778           5 :                 zend_hash_update(intern->parameter, name, &new_string);
     779           5 :                 RETURN_TRUE;
     780             :         } else {
     781           0 :                 WRONG_PARAM_COUNT;
     782             :         }
     783             : 
     784             : }
     785             : /* }}} end xsl_xsltprocessor_set_parameter */
     786             : 
     787             : /* {{{ proto string xsl_xsltprocessor_get_parameter(string namespace, string name)
     788             : */
     789           6 : PHP_FUNCTION(xsl_xsltprocessor_get_parameter)
     790             : {
     791             :         zval *id;
     792             :         char *namespace;
     793           6 :         size_t namespace_len = 0;
     794             :         zval *value;
     795             :         zend_string *name;
     796             :         xsl_object *intern;
     797             : 
     798          12 :         DOM_GET_THIS(id);
     799             : 
     800           6 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &namespace, &namespace_len, &name) == FAILURE) {
     801           3 :                 RETURN_FALSE;
     802             :         }
     803           3 :         intern = Z_XSL_P(id);
     804           3 :         if ((value = zend_hash_find(intern->parameter, name)) != NULL) {
     805           1 :                 convert_to_string_ex(value);
     806           1 :                 RETURN_STR_COPY(Z_STR_P(value));
     807             :         } else {
     808           2 :                 RETURN_FALSE;
     809             :         }
     810             : }
     811             : /* }}} end xsl_xsltprocessor_get_parameter */
     812             : 
     813             : /* {{{ proto bool xsl_xsltprocessor_remove_parameter(string namespace, string name)
     814             : */
     815           5 : PHP_FUNCTION(xsl_xsltprocessor_remove_parameter)
     816             : {
     817             :         zval *id;
     818           5 :         size_t namespace_len = 0;
     819             :         char *namespace;
     820             :         zend_string *name;
     821             :         xsl_object *intern;
     822             : 
     823          10 :         DOM_GET_THIS(id);
     824             : 
     825           5 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &namespace, &namespace_len, &name) == FAILURE) {
     826           3 :                 RETURN_FALSE;
     827             :         }
     828           2 :         intern = Z_XSL_P(id);
     829           2 :         if (zend_hash_del(intern->parameter, name) == SUCCESS) {
     830           1 :                 RETURN_TRUE;
     831             :         } else {
     832           1 :                 RETURN_FALSE;
     833             :         }
     834             : }
     835             : /* }}} end xsl_xsltprocessor_remove_parameter */
     836             : 
     837             : /* {{{ proto void xsl_xsltprocessor_register_php_functions([mixed $restrict])
     838             : */
     839          45 : PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
     840             : {
     841             :         zval *id;
     842             :         xsl_object *intern;
     843             :         zval *array_value, *entry, new_string;
     844             :         zend_string *name;
     845             : 
     846          90 :         DOM_GET_THIS(id);
     847             : 
     848          45 :         if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "a",  &array_value) == SUCCESS) {
     849          15 :                 intern = Z_XSL_P(id);
     850             : 
     851          45 :                 ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array_value), entry) {
     852          15 :                         convert_to_string_ex(entry);
     853          15 :                         ZVAL_LONG(&new_string ,1);
     854          15 :                         zend_hash_update(intern->registered_phpfunctions, Z_STR_P(entry), &new_string);
     855             :                 } ZEND_HASH_FOREACH_END();
     856             : 
     857          15 :                 intern->registerPhpFunctions = 2;
     858          30 :         } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "S",  &name) == SUCCESS) {
     859           6 :                 intern = Z_XSL_P(id);
     860             : 
     861           6 :                 ZVAL_LONG(&new_string,1);
     862           6 :                 zend_hash_update(intern->registered_phpfunctions, name, &new_string);
     863           6 :                 intern->registerPhpFunctions = 2;
     864             : 
     865             :         } else {
     866          24 :                 intern = Z_XSL_P(id);
     867          24 :                 intern->registerPhpFunctions = 1;
     868             :         }
     869             : 
     870             : }
     871             : /* }}} end xsl_xsltprocessor_register_php_functions(); */
     872             : 
     873             : /* {{{ proto bool xsl_xsltprocessor_set_profiling(string filename) */
     874           0 : PHP_FUNCTION(xsl_xsltprocessor_set_profiling)
     875             : {
     876             :         zval *id;
     877             :         xsl_object *intern;
     878           0 :         char *filename = NULL;
     879             :         size_t filename_len;
     880           0 :         DOM_GET_THIS(id);
     881             : 
     882           0 :         if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "p!", &filename, &filename_len) == SUCCESS) {
     883           0 :                 intern = Z_XSL_P(id);
     884           0 :                 if (intern->profiling) {
     885           0 :                         efree(intern->profiling);
     886             :                 }
     887           0 :                 if (filename != NULL) {
     888           0 :                         intern->profiling = estrndup(filename, filename_len);
     889             :                 } else {
     890           0 :                         intern->profiling = NULL;
     891             :                 }
     892           0 :                 RETURN_TRUE;
     893             :         } else {
     894           0 :                 WRONG_PARAM_COUNT;
     895             :         }
     896             : }
     897             : /* }}} end xsl_xsltprocessor_set_profiling */
     898             : 
     899             : /* {{{ proto long xsl_xsltprocessor_set_security_prefs(long securityPrefs) */
     900           4 : PHP_FUNCTION(xsl_xsltprocessor_set_security_prefs)
     901             : {
     902             :         zval *id;
     903             :         xsl_object *intern;
     904             :         zend_long securityPrefs, oldSecurityPrefs;
     905             : 
     906           8 :         DOM_GET_THIS(id);
     907           4 :         if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &securityPrefs) == FAILURE) {
     908           0 :                 return;
     909             :         }
     910           4 :         intern = Z_XSL_P(id);
     911           4 :         oldSecurityPrefs = intern->securityPrefs;
     912           4 :         intern->securityPrefs = securityPrefs;
     913             :         /* set this to 1 so that we know, it was set through this method. Can be removed, when we remove the ini setting */
     914           4 :         intern->securityPrefsSet = 1;
     915           4 :         RETURN_LONG(oldSecurityPrefs);
     916             : }
     917             : /* }}} end xsl_xsltprocessor_set_security_prefs */
     918             : 
     919             : /* {{{ proto long xsl_xsltprocessor_get_security_prefs() */
     920           0 : PHP_FUNCTION(xsl_xsltprocessor_get_security_prefs)
     921             : {
     922             :         zval *id;
     923             :         xsl_object *intern;
     924             : 
     925           0 :         DOM_GET_THIS(id);
     926           0 :         if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "") == SUCCESS) {
     927           0 :                 intern = Z_XSL_P(id);
     928           0 :                 RETURN_LONG(intern->securityPrefs);
     929             :         } else {
     930           0 :                 WRONG_PARAM_COUNT;
     931             :         }
     932             : }
     933             : /* }}} end xsl_xsltprocessor_get_security_prefs */
     934             : 
     935             : /* {{{ proto bool xsl_xsltprocessor_has_exslt_support()
     936             : */
     937           3 : PHP_FUNCTION(xsl_xsltprocessor_has_exslt_support)
     938             : {
     939             : #if HAVE_XSL_EXSLT
     940           3 :         RETURN_TRUE;
     941             : #else
     942             :         RETURN_FALSE;
     943             : #endif
     944             : }
     945             : /* }}} end xsl_xsltprocessor_has_exslt_support(); */
     946             : 
     947             : /*
     948             :  * Local variables:
     949             :  * tab-width: 4
     950             :  * c-basic-offset: 4
     951             :  * End:
     952             :  * vim600: sw=4 ts=4 fdm=marker
     953             :  * vim<600: sw=4 ts=4
     954             :  */

Generated by: LCOV version 1.10

Generated at Tue, 26 Jul 2016 17:07:48 +0000 (31 hours ago)

Copyright © 2005-2016 The PHP Group
All rights reserved.