summaryrefslogtreecommitdiff
path: root/ext/soap
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2012-03-05 12:59:01 +0000
committerDmitry Stogov <dmitry@php.net>2012-03-05 12:59:01 +0000
commita05a3a0a4a2493b8f9065ff05c5792c31cfdae7e (patch)
tree15b5d48d9a4d90f978ffa548c619ab51740c8053 /ext/soap
parente182aeec107a934eb6994e77948b9376bc35f9ee (diff)
downloadphp-git-a05a3a0a4a2493b8f9065ff05c5792c31cfdae7e.tar.gz
Fixed bug #60887 (SoapClient ignores user_agent option and sends no User-Agent header)
Diffstat (limited to 'ext/soap')
-rw-r--r--ext/soap/php_sdl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 370b1fa04b..45aee30ac1 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -3259,6 +3259,13 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
context = php_stream_context_alloc();
}
+ if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent"), (void **) &tmp) == SUCCESS &&
+ Z_TYPE_PP(tmp) == IS_STRING && Z_STRLEN_PP(tmp) > 0) {
+ smart_str_appends(&headers, "User-Agent: ");
+ smart_str_appends(&headers, Z_STRVAL_PP(tmp));
+ smart_str_appends(&headers, "\r\n");
+ }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
Z_TYPE_PP(proxy_host) == IS_STRING &&
zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", sizeof("_proxy_port"), (void **) &proxy_port) == SUCCESS &&