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

Generated by: LCOV version 1.10

Generated at Sun, 22 May 2016 10:53:07 +0000 (3 days ago)

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