#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)); \
struct xslt_processor processor;
struct xslt_error *err;
zval *object;
+ unsigned short base_isset;
} php_xslt;
#else
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;
/* Set the base */
SablotSetBase(XSLT_PROCESSOR(handle), Z_STRVAL_PP(base));
+ XSLT_BASE_ISSET(handle) = 1;
}
/* }}} */
xslt_make_array(args_p, &args);
/* Can return NULL */
if (args) {
- char *baseuri;
TSRMLS_FETCH();
i=0;
while (args[i]) {
}
/* 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);
+ }
}
}