From: Ilia Alshanetsky Date: Mon, 22 Dec 2003 16:32:29 +0000 (+0000) Subject: Fixed bug #26690 (make xsltProcessor->transformToUri use streams wrappers). X-Git-Tag: php_ibase_before_split~539 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8c58f1d79c2b535344e0fa123a0e5fdaa1ee703;p=php Fixed bug #26690 (make xsltProcessor->transformToUri use streams wrappers). --- diff --git a/NEWS b/NEWS index b873c82e3f..7ded35d264 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2004, PHP 5 RC 1 +- Fixed bug #26690 (make xsltProcessor->transformToUri use streams wrappers). + (Ilia) - Fixed bug #26675 (Segfault on ArrayAccess use). (Marcus) 21 Dec 2003, PHP 5 Beta 3 diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index eb98018046..e19795d4a0 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -297,8 +297,17 @@ PHP_FUNCTION(xsl_xsltprocessor_transform_to_uri) ret = -1; if (newdocp) { - ret = xsltSaveResultToFilename(uri, newdocp, sheetp, 0); + int fd; + php_stream *stream = php_stream_open_wrapper_ex(uri, "wb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL); + + if (php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fd, 1) == FAILURE) { + goto done; + } + + ret = xsltSaveResultToFd(fd, newdocp, sheetp); +done: xmlFreeDoc(newdocp); + php_stream_close(stream); } RETVAL_LONG(ret);