diff options
| author | Dmitry Stogov <dmitry@php.net> | 2004-11-09 08:13:35 +0000 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@php.net> | 2004-11-09 08:13:35 +0000 |
| commit | 9c5661f05d394e82e709b2c3de3f7e909e3c2fe2 (patch) | |
| tree | b817973878f6a63f893da225a97e3aece6c79edb /ext/libxml | |
| parent | d61a7f12072a6fdb8d5ddfb7727d0a25dd2e8375 (diff) | |
| download | php-git-9c5661f05d394e82e709b2c3de3f7e909e3c2fe2.tar.gz | |
Fixed bug #29211 (SoapClient doesn't request wsdl through proxy). (Rob)
Diffstat (limited to 'ext/libxml')
| -rw-r--r-- | ext/libxml/libxml.c | 28 | ||||
| -rw-r--r-- | ext/libxml/php_libxml.h | 2 |
2 files changed, 23 insertions, 7 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 8eac2eb8e5..9053e79582 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -243,10 +243,18 @@ static void php_libxml_init_globals(php_libxml_globals *libxml_globals_p TSRMLS_ int php_libxml_streams_IO_match_wrapper(const char *filename) { + char *resolved_path; + int retval; + TSRMLS_FETCH(); if (zend_is_executing(TSRMLS_C)) { - return php_stream_locate_url_wrapper(filename, NULL, 0 TSRMLS_CC) ? 1 : 0; + resolved_path = xmlURIUnescapeString(filename, 0, NULL); + retval = php_stream_locate_url_wrapper(resolved_path, NULL, 0 TSRMLS_CC) ? 1 : 0; + if (resolved_path) { + xmlFree(resolved_path); + } + return retval; } return 0; } @@ -274,7 +282,7 @@ void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode, in xml processing (eg. DTD files) */ wrapper = php_stream_locate_url_wrapper(resolved_path, &path_to_open, ENFORCE_SAFE_MODE TSRMLS_CC); if (wrapper && read_only && wrapper->wops->url_stat) { - if (wrapper->wops->url_stat(wrapper, path_to_open, 0, &ssbuf, NULL TSRMLS_CC) == -1) { + if (wrapper->wops->url_stat(wrapper, path_to_open, PHP_STREAM_URL_STAT_QUIET, &ssbuf, NULL TSRMLS_CC) == -1) { xmlFree(resolved_path); return NULL; } @@ -282,11 +290,9 @@ void *php_libxml_streams_IO_open_wrapper(const char *filename, const char *mode, if (LIBXML(stream_context)) { context = zend_fetch_resource(&LIBXML(stream_context) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context()); - ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, context); - xmlFree(resolved_path); - return ret_val; } - ret_val = php_stream_open_wrapper(path_to_open, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL); + + ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, context); xmlFree(resolved_path); return ret_val; } @@ -432,6 +438,15 @@ PHP_LIBXML_API void php_libxml_shutdown() { } } +PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC) { + zval *oldcontext; + + oldcontext = LIBXML(stream_context); + LIBXML(stream_context) = context; + return oldcontext; + +} + PHP_MINIT_FUNCTION(libxml) { php_libxml_initialize(); @@ -503,7 +518,6 @@ PHP_FUNCTION(libxml_set_streams_context) } /* }}} */ - /* {{{ Common functions shared by extensions */ int php_libxml_xmlCheckUTF8(const unsigned char *s) { diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h index 9f7c96f2ed..a4643809e3 100644 --- a/ext/libxml/php_libxml.h +++ b/ext/libxml/php_libxml.h @@ -67,6 +67,7 @@ typedef struct _php_libxml_node_object { typedef void * (*php_libxml_export_node) (zval *object TSRMLS_DC); PHP_FUNCTION(libxml_set_streams_context); + int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data TSRMLS_DC); int php_libxml_decrement_node_ptr(php_libxml_node_object *object TSRMLS_DC); int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp TSRMLS_DC); @@ -81,6 +82,7 @@ PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...); void php_libxml_ctx_warning(void *ctx, const char *msg, ...); void php_libxml_ctx_error(void *ctx, const char *msg, ...); PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s); +PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC); #endif /* HAVE_LIBXML */ |
