]> granicus.if.org Git - php/commitdiff
MFH: Allow non-long values for proxy_port, connection_timeout and convert them
authorDavid Soria Parra <dsp@php.net>
Tue, 20 May 2008 13:16:47 +0000 (13:16 +0000)
committerDavid Soria Parra <dsp@php.net>
Tue, 20 May 2008 13:16:47 +0000 (13:16 +0000)
ext/soap/soap.c

index 4e635a42dcb8d06476c3c1c333aff6a71d06f543..50eae66e36f3e91bcf265016eac6fb349648a1c0 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 &&
@@ -2463,8 +2463,9 @@ PHP_METHOD(SoapClient, SoapClient)
                        add_property_long(this_ptr, "_features", Z_LVAL_PP(tmp));
            }
 
-               if (zend_hash_find(ht, "connection_timeout", sizeof("connection_timeout"), (void**)&tmp) == SUCCESS &&
-                   Z_TYPE_PP(tmp) == IS_LONG && Z_LVAL_PP(tmp) > 0) {
+               if (zend_hash_find(ht, "connection_timeout", sizeof("connection_timeout"), (void**)&tmp) == SUCCESS) {
+                       convert_to_long(*tmp);
+                       if (Z_LVAL_PP(tmp) > 0)
                        add_property_long(this_ptr, "_connection_timeout", Z_LVAL_PP(tmp));
                }