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

Generated by: LCOV version 1.10

Generated at Fri, 05 Feb 2016 08:39:28 +0000 (3 days ago)

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