From df71cbc0d52f64928a28c725c5db639da3c274c2 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Mon, 5 Jan 2009 22:16:58 +0000 Subject: [PATCH] - Fixed bug #46760 (SoapClient doRequest fails when proxy is used) [only in this branch] --- ext/soap/soap.c | 4 ++-- ext/soap/tests/bug46760.phpt | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 ext/soap/tests/bug46760.phpt diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 3b9694c544..6321a82813 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2381,8 +2381,8 @@ PHP_METHOD(SoapClient, SoapClient) if (zend_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { add_property_stringl(this_ptr, "_proxy_host", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG) { + if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS) { + convert_to_long(*tmp); add_property_long(this_ptr, "_proxy_port", Z_LVAL_PP(tmp)); } if (zend_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS && diff --git a/ext/soap/tests/bug46760.phpt b/ext/soap/tests/bug46760.phpt new file mode 100644 index 0000000000..0b7c9ab4c1 --- /dev/null +++ b/ext/soap/tests/bug46760.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #46760 (SoapClient doRequest fails when proxy is used) +--FILE-- + "localhost", + 'proxy_port' => '8080', + 'login' => "user", + 'password' => "test", + 'uri' => 'mo:http://www.w3.org/', + 'location' => 'http://some.url')); +var_dump($client->_proxy_port); + +?> +--EXPECT-- +int(8080) -- 2.40.0