rrichards               Mon Dec 22 11:46:26 2003 EDT

  Modified files:              
    /php-src/ext/libxml libxml.c 
  Log:
  only test url_stat in read mode
  
Index: php-src/ext/libxml/libxml.c
diff -u php-src/ext/libxml/libxml.c:1.11 php-src/ext/libxml/libxml.c:1.12
--- php-src/ext/libxml/libxml.c:1.11    Fri Dec 12 08:54:06 2003
+++ php-src/ext/libxml/libxml.c Mon Dec 22 11:46:26 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: libxml.c,v 1.11 2003/12/12 13:54:06 rrichards Exp $ */
+/* $Id: libxml.c,v 1.12 2003/12/22 16:46:26 rrichards Exp $ */
 
 #define IS_EXT_MODULE
 
@@ -238,7 +238,7 @@
        return php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC) ? 1 : 0;
 }
 
-void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode)
+void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode, 
const int read_only)
 {
        char resolved_path[MAXPATHLEN + 1];
        php_stream_statbuf ssbuf;
@@ -257,7 +257,7 @@
           may try to open files that don't exist, but it is not a failure
           in xml processing (eg. DTD files)  */
        wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, 
ENFORCE_SAFE_MODE TSRMLS_CC);
-       if (wrapper && wrapper->wops->url_stat) {
+       if (wrapper && read_only && wrapper->wops->url_stat) {
                if (wrapper->wops->url_stat(wrapper, path_to_open, 0, &ssbuf, NULL 
TSRMLS_CC) == -1) {
                        return NULL;
                }
@@ -272,12 +272,12 @@
 
 void *php_libxml_streams_IO_open_read_wrapper(const char *filename)
 {
-       return php_libxml_streams_IO_open_wrapper(filename, "rb");
+       return php_libxml_streams_IO_open_wrapper(filename, "rb", 1);
 }
 
 void *php_libxml_streams_IO_open_write_wrapper(const char *filename)
 {
-       return php_libxml_streams_IO_open_wrapper(filename, "wb");
+       return php_libxml_streams_IO_open_wrapper(filename, "wb", 0);
 }
 
 int php_libxml_streams_IO_read(void *context, char *buffer, int len)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to