msopacua Thu Nov 21 18:32:53 2002 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/xslt php_sablot.h sablot.c
Log:
MFH Fix bug #20518
Index: php4/ext/xslt/php_sablot.h
diff -u php4/ext/xslt/php_sablot.h:1.17 php4/ext/xslt/php_sablot.h:1.17.2.1
--- php4/ext/xslt/php_sablot.h:1.17 Sun Nov 10 07:18:02 2002
+++ php4/ext/xslt/php_sablot.h Thu Nov 21 18:32:53 2002
@@ -46,6 +46,7 @@
#define XSLT_ERRNO(handle) ((handle)->err->no)
#define XSLT_ERRSTR(handle) ((handle)->err->str)
#define XSLT_LOG(handle) ((handle)->err->log)
+#define XSLT_BASE_ISSET(handle) ((handle)->base_isset)
#define XSLT_FUNCH_FREE(__var) if (__var) zval_ptr_dtor(&(__var));
#define XSLT_REG_ERRMSG(msg, handle) if (XSLT_ERRSTR(handle))
efree(XSLT_ERRSTR(handle)); \
@@ -124,6 +125,7 @@
struct xslt_processor processor;
struct xslt_error *err;
zval *object;
+ unsigned short base_isset;
} php_xslt;
#else
Index: php4/ext/xslt/sablot.c
diff -u php4/ext/xslt/sablot.c:1.68 php4/ext/xslt/sablot.c:1.68.2.1
--- php4/ext/xslt/sablot.c:1.68 Sun Nov 10 07:18:02 2002
+++ php4/ext/xslt/sablot.c Thu Nov 21 18:32:53 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sablot.c,v 1.68 2002/11/10 12:18:02 msopacua Exp $ */
+/* $Id: sablot.c,v 1.68.2.1 2002/11/21 23:32:53 msopacua Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -218,6 +218,7 @@
handle->handlers = ecalloc(1, sizeof(struct xslt_handlers));
handle->err = ecalloc(1, sizeof(struct xslt_error));
handle->object = NULL;
+ handle->base_isset = 0;
XSLT_LOG(handle).path = NULL;
@@ -435,6 +436,7 @@
/* Set the base */
SablotSetBase(XSLT_PROCESSOR(handle), Z_STRVAL_PP(base));
+ XSLT_BASE_ISSET(handle) = 1;
}
/* }}} */
@@ -547,7 +549,6 @@
xslt_make_array(args_p, &args);
/* Can return NULL */
if (args) {
- char *baseuri;
TSRMLS_FETCH();
i=0;
while (args[i]) {
@@ -559,14 +560,17 @@
}
/* Since we have args passed, we need to set the base uri, so
pull in executor
- globals and set the base, using the current filename,
specifally for the
+ globals and set the base, using the current filename,
+specifcally for the
'arg' scheme */
+ if(XSLT_BASE_ISSET(handle) == 0)
+ {
+ char *baseuri;
spprintf(&baseuri, 0, "file://%s",
zend_get_executed_filename(TSRMLS_C));
+ SablotSetBaseForScheme(XSLT_PROCESSOR(handle), "arg",
+baseuri);
- SablotSetBaseForScheme(XSLT_PROCESSOR(handle), "arg", baseuri);
-
- if(baseuri)
- efree(baseuri);
+ if(baseuri)
+ efree(baseuri);
+ }
}
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php