cvs: php4 /ext/xslt sablot.c

From: Date: Sat, 02 Nov 2002 01:32:09 +0000
Subject: cvs: php4 /ext/xslt sablot.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-15719@lists.php.net to get a copy of this message
msopacua Fri Nov 1 20:32:09 2002 EDT Modified files: /php4/ext/xslt sablot.c Log: - Fix issues with 'arg' scheme and external files, bug #20177 - Add authors # Need to rename test, grrr Index: php4/ext/xslt/sablot.c diff -u php4/ext/xslt/sablot.c:1.63 php4/ext/xslt/sablot.c:1.64 --- php4/ext/xslt/sablot.c:1.63 Fri Nov 1 09:44:05 2002 +++ php4/ext/xslt/sablot.c Fri Nov 1 20:32:08 2002 @@ -12,11 +12,14 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Author: Sterling Hughes <sterling@php.net> | + | Authors: Sterling Hughes <sterling@php.net> | + | David Viner <dviner@php.net> | + | Lehnar Lohmus <flex@php.net> | + | Melvyn Sopacua <msopacua@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: sablot.c,v 1.63 2002/11/01 14:44:05 flex Exp $ */ +/* $Id: sablot.c,v 1.64 2002/11/02 01:32:08 msopacua Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -537,6 +540,7 @@ xslt_make_array(args_p, &args); /* Can return NULL */ if (args) { + char *baseuri; i=0; while (args[i]) { /* We can safely add args[i+1] since xslt_make_array sets args[i] to NULL if @@ -545,6 +549,18 @@ SablotAddArgBuffer(XSLT_SITUATION(handle), XSLT_PROCESSOR(handle), args[i], args[i+1]); i += 2; } + + /* 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 + 'arg' scheme */ + TSRMLS_FETCH(); + baseuri = (char *)emalloc(strlen(zend_get_executed_filename(TSRMLS_C))+7+1); + sprintf(baseuri, "file://%s", zend_get_executed_filename(TSRMLS_C)); + + SablotSetBaseForScheme(XSLT_PROCESSOR(handle), "arg", baseuri); + + if(baseuri) + efree(baseuri); } }

« previous php.cvs (#15719) next »