diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2003-12-22 16:32:29 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2003-12-22 16:32:29 +0000 |
commit | a8c58f1d79c2b535344e0fa123a0e5fdaa1ee703 (patch) | |
tree | 039ff00c9088694c4a2a194a5e2c3a5c5983410a /ext/xsl | |
parent | 06788f04384f9f7db0f86e5acb580dd7b11e9be0 (diff) | |
download | php-git-a8c58f1d79c2b535344e0fa123a0e5fdaa1ee703.tar.gz |
Fixed bug #26690 (make xsltProcessor->transformToUri use streams wrappers).
Diffstat (limited to 'ext/xsl')
-rw-r--r-- | ext/xsl/xsltprocessor.c | 11 |
1 files changed, 10 insertions, 1 deletions
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); |