]> granicus.if.org Git - php/commitdiff
Allow SOAP work when allow_url_fopen is turned off.
authorDmitry Stogov <dmitry@php.net>
Mon, 1 Aug 2005 11:38:02 +0000 (11:38 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 1 Aug 2005 11:38:02 +0000 (11:38 +0000)
ext/soap/php_http.c
ext/soap/php_xml.c

index 70c16645f66285835e19ee20e2c4b664635bff5d..dfbae27c1bc4ecf2b73f457b5785b43060d8719d 100644 (file)
@@ -234,6 +234,7 @@ int make_http_soap_request(zval  *this_ptr,
        int http_status;
        int content_type_xml = 0;
        char *content_encoding;
+       zend_bool old_allow_url_fopen;
 
        if (this_ptr == NULL || Z_TYPE_P(this_ptr) != IS_OBJECT) {
                return FALSE;
@@ -315,10 +316,14 @@ try_again:
                add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL TSRMLS_CC);
                return FALSE;
        }
+
+       old_allow_url_fopen = PG(allow_url_fopen);
+       PG(allow_url_fopen) = 1;
        if (use_ssl && php_stream_locate_url_wrapper("https://", NULL, STREAM_LOCATE_WRAPPERS_ONLY TSRMLS_CC) == NULL) {
                php_url_free(phpurl);
                if (request != buf) {efree(request);}
-               add_soap_fault(this_ptr, "HTTP", "SSL support not available in this build", NULL, NULL TSRMLS_CC);
+               add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL TSRMLS_CC);
+               PG(allow_url_fopen) = old_allow_url_fopen;
                return FALSE;
        }
 
@@ -367,9 +372,11 @@ try_again:
                        php_url_free(phpurl);
                        if (request != buf) {efree(request);}
                        add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL TSRMLS_CC);
+                       PG(allow_url_fopen) = old_allow_url_fopen;
                        return FALSE;
                }
        }
+       PG(allow_url_fopen) = old_allow_url_fopen;
 
        if (stream) {
                zval **cookies, **login, **password;
index 3746c805e10f510e92e33a71c86832b8bfd3be00..73035ee56c9a3e3bda1c08ec121e5540c7927c34 100644 (file)
@@ -80,11 +80,16 @@ xmlDocPtr soap_xmlParseFile(const char *filename)
 {
        xmlParserCtxtPtr ctxt = NULL;
        xmlDocPtr ret;
+       zend_bool old_allow_url_fopen;
 
 /*
        xmlInitParser();
 */
+
+       old_allow_url_fopen = PG(allow_url_fopen);
+       PG(allow_url_fopen) = 1;
        ctxt = xmlCreateFileParserCtxt(filename);
+       PG(allow_url_fopen) = old_allow_url_fopen;
        if (ctxt) {
                ctxt->keepBlanks = 0;
                ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;