]> granicus.if.org Git - php/commitdiff
Fixed bug #26690 (make xsltProcessor->transformToUri use streams wrappers).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 22 Dec 2003 16:32:29 +0000 (16:32 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 22 Dec 2003 16:32:29 +0000 (16:32 +0000)
NEWS
ext/xsl/xsltprocessor.c

diff --git a/NEWS b/NEWS
index b873c82e3f7711aabc974de73c3c8aa9c9391a3f..7ded35d2640f24b02a82c5bb78c63ad0a9ea3374 100644 (file)
--- 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
index eb98018046274a56022fed7c7af151ba7ed03666..e19795d4a006cac95fce9a6f4092e04061fa9680 100644 (file)
@@ -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);