cvs: php-src /ext/libxml libxml.c

From: Date: Sun, 19 Oct 2003 23:25:49 +0000
Subject: cvs: php-src /ext/libxml libxml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-24179@lists.php.net to get a copy of this message
rrichards Sun Oct 19 19:25:49 2003 EDT Modified files: /php-src/ext/libxml libxml.c Log: unescape filepath which libxml excapes Index: php-src/ext/libxml/libxml.c diff -u php-src/ext/libxml/libxml.c:1.2 php-src/ext/libxml/libxml.c:1.3 --- php-src/ext/libxml/libxml.c:1.2 Sun Oct 19 19:17:56 2003 +++ php-src/ext/libxml/libxml.c Sun Oct 19 19:25:48 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: libxml.c,v 1.2 2003/10/19 23:17:56 shane Exp $ */ +/* $Id: libxml.c,v 1.3 2003/10/19 23:25:48 rrichards Exp $ */ #define IS_EXT_MODULE @@ -109,13 +109,23 @@ void *php_libxml_streams_IO_open_wrapper(const char *filename) { + char resolved_path[MAXPATHLEN + 1]; + int file_exist; + php_stream_statbuf ssbuf; php_stream_context *context = NULL; + TSRMLS_FETCH(); + xmlURIUnescapeString(filename, 0, resolved_path); + file_exist = _php_stream_stat_path((char *) resolved_path, &ssbuf TSRMLS_CC); + if (file_exist == -1) { + return NULL; + } + if (LIBXML(stream_context)) { context = zend_fetch_resource(&LIBXML(stream_context) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context()); - return php_stream_open_wrapper_ex((char *)filename, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, context); + return php_stream_open_wrapper_ex((char *)resolved_path, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, context); } - return php_stream_open_wrapper((char *)filename, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); + return php_stream_open_wrapper((char *)resolved_path, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); } int php_libxml_streams_IO_read(void *context, char *buffer, int len)

« previous php.cvs (#24179) next »