diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:37 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:37 -0400 |
| commit | 10f5b47dc7c1cf2b9a00991629f43652710322d3 (patch) | |
| tree | 3b727a16f652b8042d573e90f003868ffb3b56c7 /ext/xsl | |
| parent | 0e920280a2e04b110827bb766b9f29e3d581c4ee (diff) | |
| download | php-10f5b47dc7c1cf2b9a00991629f43652710322d3.tar.gz | |
Imported Upstream version 5.0.5upstream/5.0.5
Diffstat (limited to 'ext/xsl')
| -rw-r--r-- | ext/xsl/config.m4 | 14 | ||||
| -rwxr-xr-x | ext/xsl/tests/bug33853.phpt | 33 | ||||
| -rw-r--r-- | ext/xsl/xsltprocessor.c | 4 |
3 files changed, 44 insertions, 7 deletions
diff --git a/ext/xsl/config.m4 b/ext/xsl/config.m4 index 42219588c..18827ef62 100644 --- a/ext/xsl/config.m4 +++ b/ext/xsl/config.m4 @@ -1,17 +1,21 @@ dnl -dnl $Id: config.m4,v 1.7 2003/11/19 12:07:59 chregu Exp $ +dnl $Id: config.m4,v 1.7.2.1 2005/04/27 13:13:38 sniper Exp $ dnl PHP_ARG_WITH(xsl, for XSL support, [ --with-xsl[=DIR] Include new XSL support (requires libxslt >= 1.0.18). DIR is the libxslt install directory.]) -if test "$PHP_XSL" != "no" -a "$PHP_DOM" = "no"; then - AC_MSG_ERROR([XSL extension requires DOM extension, add --enable-dom.]) -fi - if test "$PHP_XSL" != "no"; then + if test "$PHP_LIBXML" = "no"; then + AC_MSG_ERROR([XSL extension requires LIBXML extension, add --enable-libxml]) + fi + + if test "$PHP_DOM" = "no"; then + AC_MSG_ERROR([XSL extension requires DOM extension, add --enable-dom]) + fi + for i in $PHP_XSL /usr/local /usr; do if test -x "$i/bin/xslt-config"; then XSLT_CONFIG=$i/bin/xslt-config diff --git a/ext/xsl/tests/bug33853.phpt b/ext/xsl/tests/bug33853.phpt new file mode 100755 index 000000000..bcf30f65a --- /dev/null +++ b/ext/xsl/tests/bug33853.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #33853 (php:function call __autoload with lowercase param) +--SKIPIF-- +<?php if (!extension_loaded('xsl')) die('skip xsl not loaded'); ?> +--FILE-- +<?php + +function __autoload($className) { + var_dump($className); + exit(); +} + +$xsl = new DomDocument(); +$xsl->loadXML('<?xml version="1.0" encoding="iso-8859-1" ?> +<xsl:stylesheet version="1.0" +xmlns:xsl="http://www.w3.org/1999/XSL/Transform" +xmlns:php="http://php.net/xsl"> +<xsl:template match="/"> +<xsl:value-of select="php:function(\'TeSt::dateLang\')" /> +</xsl:template> +</xsl:stylesheet>'); +$inputdom = new DomDocument(); +$inputdom->loadXML('<?xml version="1.0" encoding="iso-8859-1" ?> +<today></today>'); + +$proc = new XsltProcessor(); +$proc->registerPhpFunctions(); +$xsl = $proc->importStylesheet($xsl); +$newdom = $proc->transformToDoc($inputdom); +?> +===DONE=== +--EXPECT-- +string(4) "TeSt" diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index eeca05a2a..6ffa0bac4 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: xsltprocessor.c,v 1.29.2.5 2005/01/17 16:01:35 chregu Exp $ */ +/* $Id: xsltprocessor.c,v 1.29.2.6 2005/06/14 19:40:33 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -200,7 +200,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t int j; dom_object *domintern; array_init(args[i]); - if (obj->nodesetval->nodeNr > 0) { + if (obj->nodesetval && obj->nodesetval->nodeNr > 0) { domintern = (dom_object *) php_dom_object_get_data((void *) obj->nodesetval->nodeTab[0]->doc); for (j = 0; j < obj->nodesetval->nodeNr; j++) { xmlNodePtr node = obj->nodesetval->nodeTab[j]; |
