cvs: php-src /ext/soap php_http.c php_xml.c
| From: | Dmitry Stogov | Date: | Mon, 01 Aug 2005 11:38:02 +0000 |
| Subject: | cvs: php-src /ext/soap php_http.c php_xml.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-33142@lists.php.net to get a copy of this message | ||
dmitry Mon Aug 1 07:38:02 2005 EDT
Modified files:
/php-src/ext/soap php_http.c php_xml.c
Log:
Allow SOAP work when allow_url_fopen is turned off.
http://cvs.php.net/diff.php/php-src/ext/soap/php_http.c?r1=1.75&r2=1.76&ty=u
Index: php-src/ext/soap/php_http.c
diff -u php-src/ext/soap/php_http.c:1.75 php-src/ext/soap/php_http.c:1.76
--- php-src/ext/soap/php_http.c:1.75 Wed Jul 20 06:21:49 2005
+++ php-src/ext/soap/php_http.c Mon Aug 1 07:38:01 2005
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_http.c,v 1.75 2005/07/20 10:21:49 dmitry Exp $ */
+/* $Id: php_http.c,v 1.76 2005/08/01 11:38:01 dmitry Exp $ */
#include "php_soap.h"
#include "ext/standard/base64.h"
@@ -234,6 +234,7 @@
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 @@
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 @@
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;
http://cvs.php.net/diff.php/php-src/ext/soap/php_xml.c?r1=1.22&r2=1.23&ty=u
Index: php-src/ext/soap/php_xml.c
diff -u php-src/ext/soap/php_xml.c:1.22 php-src/ext/soap/php_xml.c:1.23
--- php-src/ext/soap/php_xml.c:1.22 Fri Feb 13 10:19:09 2004
+++ php-src/ext/soap/php_xml.c Mon Aug 1 07:38:02 2005
@@ -17,7 +17,7 @@
| Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_xml.c,v 1.22 2004/02/13 15:19:09 dmitry Exp $ */
+/* $Id: php_xml.c,v 1.23 2005/08/01 11:38:02 dmitry Exp $ */
#include "php_soap.h"
#include "libxml/parser.h"
@@ -80,11 +80,16 @@
{
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;