summaryrefslogtreecommitdiff
path: root/ext/xsl/xsltprocessor.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/xsl/xsltprocessor.c')
-rw-r--r--ext/xsl/xsltprocessor.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 59da05172..1345c10c6 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.15 2008/12/31 11:15:47 sebastian Exp $ */
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.9.2.19 2009/06/06 02:40:49 mattwil Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -153,11 +153,13 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS
if (!xpath_params) {
xpath_expr = php_xsl_xslt_string_to_xpathexpr(Z_STRVAL_PP(value) TSRMLS_CC);
} else {
- xpath_expr = estrndup(Z_STRVAL_PP(value), strlen(Z_STRVAL_PP(value)));
+ xpath_expr = estrndup(Z_STRVAL_PP(value), Z_STRLEN_PP(value));
}
if (xpath_expr) {
params[i++] = string_key;
params[i++] = xpath_expr;
+ } else {
+ efree(string_key);
}
}
}
@@ -314,7 +316,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", callable);
} else if ( intern->registerPhpFunctions == 2 && zend_hash_exists(intern->registered_phpfunctions, callable, strlen(callable) + 1) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to call handler '%s()'.", callable);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not allowed to call handler '%s()'", callable);
/* Push an empty string, so that we at least have an xslt result... */
valuePush(ctxt, xmlXPathNewString(""));
} else {
@@ -341,7 +343,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
} else if (retval->type == IS_BOOL) {
valuePush(ctxt, xmlXPathNewBoolean(retval->value.lval));
} else if (retval->type == IS_OBJECT) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object can not be converted to a XPath-string");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
valuePush(ctxt, xmlXPathNewString(""));
} else {
convert_to_string_ex(&retval);
@@ -812,7 +814,6 @@ PHP_FUNCTION(xsl_xsltprocessor_register_php_functions)
zend_hash_move_forward(Z_ARRVAL_P(array_value));
}
intern->registerPhpFunctions = 2;
- RETURN_TRUE;
} else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == SUCCESS) {
intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC);