summaryrefslogtreecommitdiff
path: root/ext/xsl
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
committerMark A. Hershberger <mah@debian.(none)>2009-03-25 00:37:27 -0400
commit2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b (patch)
tree41ccc042009cba53e4ce43e727fcba4c1cfbf7f3 /ext/xsl
parentd29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (diff)
downloadphp-upstream/5.2.2.tar.gz
Imported Upstream version 5.2.2upstream/5.2.2
Diffstat (limited to 'ext/xsl')
-rw-r--r--ext/xsl/php_xsl.c21
-rw-r--r--ext/xsl/php_xsl.h4
-rw-r--r--ext/xsl/xsl_fe.h4
-rw-r--r--ext/xsl/xsltprocessor.c22
4 files changed, 20 insertions, 31 deletions
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index b176c2e97..0c840060f 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xsl.c,v 1.32.2.6 2006/03/29 14:28:43 tony2001 Exp $ */
+/* $Id: php_xsl.c,v 1.32.2.6.2.2 2007/01/12 12:17:32 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -28,9 +28,6 @@
#include "php_xsl.h"
-/* If you declare any globals in php_xsl.h uncomment this:
-ZEND_DECLARE_MODULE_GLOBALS(xsl)
-*/
zend_class_entry *xsl_xsltprocessor_class_entry;
static zend_object_handlers xsl_object_handlers;
@@ -253,10 +250,6 @@ zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in,
*/
PHP_MSHUTDOWN_FUNCTION(xsl)
{
- /* uncomment this line if you have INI entries
- UNREGISTER_INI_ENTRIES();
- */
-
xsltUnregisterExtModuleFunction ((const xmlChar *) "functionString",
(const xmlChar *) "http://php.net/xsl");
xsltUnregisterExtModuleFunction ((const xmlChar *) "function",
@@ -268,7 +261,6 @@ PHP_MSHUTDOWN_FUNCTION(xsl)
}
/* }}} */
-/* Remove if there's nothing to do at request start */
/* {{{ PHP_RINIT_FUNCTION
*/
PHP_RINIT_FUNCTION(xsl)
@@ -278,7 +270,6 @@ PHP_RINIT_FUNCTION(xsl)
}
/* }}} */
-/* Remove if there's nothing to do at request end */
/* {{{ PHP_RSHUTDOWN_FUNCTION
*/
PHP_RSHUTDOWN_FUNCTION(xsl)
@@ -310,14 +301,10 @@ PHP_MINFO_FUNCTION(xsl)
php_info_print_table_row(2, "libxslt compiled against libxml Version", buffer);
}
#if HAVE_XSL_EXSLT
- php_info_print_table_row(2, "EXSLT", "enabled");
- php_info_print_table_row(2, "libexslt Version", LIBEXSLT_DOTTED_VERSION);
+ php_info_print_table_row(2, "EXSLT", "enabled");
+ php_info_print_table_row(2, "libexslt Version", LIBEXSLT_DOTTED_VERSION);
#endif
php_info_print_table_end();
-
- /* Remove comments if you have entries in php.ini
- DISPLAY_INI_ENTRIES();
- */
}
/* }}} */
diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h
index 3b9af6062..b94037904 100644
--- a/ext/xsl/php_xsl.h
+++ b/ext/xsl/php_xsl.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_xsl.h,v 1.15.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: php_xsl.h,v 1.15.2.1.2.1 2007/01/01 09:36:10 sebastian Exp $ */
#ifndef PHP_XSL_H
#define PHP_XSL_H
diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h
index d8c3c66ba..c22d23cc2 100644
--- a/ext/xsl/xsl_fe.h
+++ b/ext/xsl/xsl_fe.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xsl_fe.h,v 1.8.2.1 2006/01/01 12:50:17 sniper Exp $ */
+/* $Id: xsl_fe.h,v 1.8.2.1.2.1 2007/01/01 09:36:10 sebastian Exp $ */
#ifndef XSL_FE_H
#define XSL_FE_H
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index c67cac9dd..5e95132ff 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xsltprocessor.c,v 1.39.2.2.2.4 2006/07/31 13:05:35 chregu Exp $ */
+/* $Id: xsltprocessor.c,v 1.39.2.2.2.8 2007/01/01 09:36:10 sebastian Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -87,7 +87,7 @@ static char **php_xsl_xslt_make_params(HashTable *parht, int xpath_params TSRMLS
int i = 0;
parsize = (2 * zend_hash_num_elements(parht) + 1) * sizeof(char *);
- params = (char **)emalloc(parsize);
+ params = (char **)safe_emalloc((2 * zend_hash_num_elements(parht) + 1), sizeof(char *), 0);
memset((char *)params, 0, parsize);
for (zend_hash_internal_pointer_reset(parht);
@@ -268,7 +268,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
} 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);
- // Push an empty string, so that we at least have an xslt result...
+ /* Push an empty string, so that we at least have an xslt result... */
valuePush(ctxt, xmlXPathNewString(""));
} else {
result = zend_call_function(&fci, NULL TSRMLS_CC);
@@ -384,13 +384,15 @@ PHP_FUNCTION(xsl_xsltprocessor_import_stylesheet)
efree(member);
if (clone_docu == 0) {
/* check if the stylesheet is using xsl:key, if yes, we have to clone the document _always_ before a transformation */
- nodep = xmlDocGetRootElement(sheetp->doc)->children;
- while (nodep) {
- if (nodep->type == XML_ELEMENT_NODE && xmlStrEqual(nodep->name, "key") && xmlStrEqual(nodep->ns->href, XSLT_NAMESPACE)) {
- intern->hasKeys = 1;
- break;
+ nodep = xmlDocGetRootElement(sheetp->doc);
+ if (nodep && (nodep = nodep->children)) {
+ while (nodep) {
+ if (nodep->type == XML_ELEMENT_NODE && xmlStrEqual(nodep->name, "key") && xmlStrEqual(nodep->ns->href, XSLT_NAMESPACE)) {
+ intern->hasKeys = 1;
+ break;
+ }
+ nodep = nodep->next;
}
- nodep = nodep->next;
}
} else {
intern->hasKeys = clone_docu;