]> granicus.if.org Git - php/commitdiff
Separate __call and __soapCall implementations
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 21 Jul 2020 10:58:52 +0000 (12:58 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 21 Jul 2020 10:59:28 +0000 (12:59 +0200)
This is overly pedantic, but allows us to enable more arginfo
consistency checks.

ext/soap/soap.c
ext/soap/soap.stub.php
ext/soap/soap_arginfo.h
ext/soap/tests/bugs/bug31755.phpt

index 846f3331b473cd79f63fe40c23c3bfb6548ec75a..9b12cea48a234f4bf83eaa5b535d58b717e019ee 100644 (file)
@@ -2512,7 +2512,7 @@ static void verify_soap_headers_array(HashTable *ht) /* {{{ */
 /* }}} */
 
 /* {{{ Calls a SOAP function */
-PHP_METHOD(SoapClient, __call)
+void soap_client_call_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_soap_call)
 {
        char *function, *location=NULL, *soap_action = NULL, *uri = NULL;
        size_t function_len;
@@ -2529,9 +2529,15 @@ PHP_METHOD(SoapClient, __call)
        zend_bool free_soap_headers = 0;
        zval *this_ptr;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS(), "sa|a!zz",
-               &function, &function_len, &args, &options, &headers, &output_headers) == FAILURE) {
-               RETURN_THROWS();
+       if (is_soap_call) {
+               if (zend_parse_parameters(ZEND_NUM_ARGS(), "sa|a!zz",
+                       &function, &function_len, &args, &options, &headers, &output_headers) == FAILURE) {
+                       RETURN_THROWS();
+               }
+       } else {
+               if (zend_parse_parameters(ZEND_NUM_ARGS(), "sa", &function, &function_len, &args) == FAILURE) {
+                       RETURN_THROWS();
+               }
        }
 
        if (options) {
@@ -2620,6 +2626,15 @@ cleanup:
 }
 /* }}} */
 
+PHP_METHOD(SoapClient, __call)
+{
+       soap_client_call_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+
+PHP_METHOD(SoapClient, __soapCall)
+{
+       soap_client_call_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
 
 /* {{{ Returns list of SOAP functions */
 PHP_METHOD(SoapClient, __getFunctions)
index 5e8e2eca287e35914a8a056902d725a5ed9916ab..60bfd5c65ed8dac8a72f79d4a0736214a699230f 100644 (file)
@@ -64,10 +64,7 @@ class SoapClient
     /** @return mixed */
     public function __call(string $function_name, array $arguments) {}
 
-    /**
-     * @return mixed
-     * @alias SoapClient::__call
-     */
+    /** @return mixed */
     public function __soapCall(string $function_name, array $arguments, ?array $options = null, $input_headers = null, $output_headers = null) {}
 
     /** @return array|null */
index d012bc4d06a35bf5615d7bdf04dd8eeded2e48e3..9ce8df198b65f50cdceed7e3390d92f752f603f7 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 43878ddb4f96ee0a2f409b87bb1484fc5378cfb5 */
+ * Stub hash: 82152767dbeda492da7dff97324d7277d3f0213b */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_use_soap_error_handler, 0, 0, _IS_BOOL, 0)
        ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, handler, _IS_BOOL, 0, "true")
@@ -153,6 +153,7 @@ ZEND_METHOD(SoapServer, addFunction);
 ZEND_METHOD(SoapServer, handle);
 ZEND_METHOD(SoapClient, __construct);
 ZEND_METHOD(SoapClient, __call);
+ZEND_METHOD(SoapClient, __soapCall);
 ZEND_METHOD(SoapClient, __getFunctions);
 ZEND_METHOD(SoapClient, __getTypes);
 ZEND_METHOD(SoapClient, __getLastRequest);
@@ -215,7 +216,7 @@ static const zend_function_entry class_SoapServer_methods[] = {
 static const zend_function_entry class_SoapClient_methods[] = {
        ZEND_ME(SoapClient, __construct, arginfo_class_SoapClient___construct, ZEND_ACC_PUBLIC)
        ZEND_ME(SoapClient, __call, arginfo_class_SoapClient___call, ZEND_ACC_PUBLIC)
-       ZEND_MALIAS(SoapClient, __soapCall, __call, arginfo_class_SoapClient___soapCall, ZEND_ACC_PUBLIC)
+       ZEND_ME(SoapClient, __soapCall, arginfo_class_SoapClient___soapCall, ZEND_ACC_PUBLIC)
        ZEND_ME(SoapClient, __getFunctions, arginfo_class_SoapClient___getFunctions, ZEND_ACC_PUBLIC)
        ZEND_ME(SoapClient, __getTypes, arginfo_class_SoapClient___getTypes, ZEND_ACC_PUBLIC)
        ZEND_ME(SoapClient, __getLastRequest, arginfo_class_SoapClient___getLastRequest, ZEND_ACC_PUBLIC)
index 600fd4305868813342baf8cd8827f3acc7430b02..d3c7ea8984c1b173c7a41b981f33fca43acff17f 100644 (file)
@@ -9,7 +9,7 @@ $client=new SOAPClient(null, array('location' => 'http://localhost',
 
 $header = new SOAPHeader(null, 'foo', 'bar');
 
-$response= $client->__call('function', array(), null, $header);
+$response= $client->__soapCall('function', array(), null, $header);
 
 print $client->__getLastRequest();
 ?>