]> granicus.if.org Git - php/commitdiff
- Fixed bug #46760 (SoapClient doRequest fails when proxy is used) [only in this...
authorFelipe Pena <felipe@php.net>
Mon, 5 Jan 2009 22:16:58 +0000 (22:16 +0000)
committerFelipe Pena <felipe@php.net>
Mon, 5 Jan 2009 22:16:58 +0000 (22:16 +0000)
ext/soap/soap.c
ext/soap/tests/bug46760.phpt [new file with mode: 0644]

index 3b9694c544bc8a6fcca32c74a30eee7203be5680..6321a82813651c1c6f437b9ab404ee1c514ef796 100644 (file)
@@ -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 (file)
index 0000000..0b7c9ab
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Bug #46760 (SoapClient doRequest fails when proxy is used)
+--FILE--
+<?php
+
+$client = new SoapClient(null, array('proxy_host'     => "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)