Accept bool in SoapClient::__doRequest

$one_way is a boolean argument.
This commit is contained in:
Nikita Popov 2020-10-08 12:35:47 +02:00
parent d3b41c4640
commit 9e32e1322e
4 changed files with 9 additions and 9 deletions

View File

@ -2188,7 +2188,7 @@ PHP_METHOD(SoapClient, __construct)
}
/* }}} */
static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, int one_way, zval *response) /* {{{ */
static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, zend_bool one_way, zval *response) /* {{{ */
{
int ret = TRUE;
char *buf;
@ -2226,7 +2226,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
ZVAL_STRING(&params[2], action);
}
ZVAL_LONG(&params[3], version);
ZVAL_LONG(&params[4], one_way);
ZVAL_BOOL(&params[4], one_way);
if (call_user_function(NULL, this_ptr, &func, response, 5, params) != SUCCESS) {
add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL);
@ -2361,7 +2361,7 @@ static void do_soap_call(zend_execute_data *execute_data,
fn = get_function(sdl, function);
if (fn != NULL) {
sdlBindingPtr binding = fn->binding;
int one_way = 0;
zend_bool one_way = 0;
if (fn->responseName == NULL &&
fn->responseParameters == NULL &&
@ -2758,10 +2758,10 @@ PHP_METHOD(SoapClient, __doRequest)
char *location, *action;
size_t location_size, action_size;
zend_long version;
zend_long one_way = 0;
zend_bool one_way = 0;
zval *this_ptr = ZEND_THIS;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sssl|l",
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sssl|b",
&buf,
&location, &location_size,
&action, &action_size,

View File

@ -93,7 +93,7 @@ class SoapClient
public function __getLastResponseHeaders() {}
/** @return string|null */
public function __doRequest(string $request, string $location, string $action, int $version, int $one_way = 0) {}
public function __doRequest(string $request, string $location, string $action, int $version, bool $one_way = false) {}
/** @return void */
public function __setCookie(string $name, ?string $value = null) {}

View File

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: b33d57ddba20c64739d51bfba39f2557026939cd */
* Stub hash: 6cba3704e7a71fa22031734207365dd88764ddb2 */
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")
@ -116,7 +116,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapClient___doRequest, 0, 0, 4)
ZEND_ARG_TYPE_INFO(0, location, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, action, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, version, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, one_way, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, one_way, _IS_BOOL, 0, "false")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapClient___setCookie, 0, 0, 1)

View File

@ -15,7 +15,7 @@ Bug #54911 (Access to a undefined member in inherit SoapClient may cause Segment
--EXPECTF--
Fatal error: Uncaught SoapFault exception: [Client] Access to undeclared static property XSoapClient::$crash in %sbug54911.php:4
Stack trace:
#0 [internal function]: XSoapClient->__doRequest('<?xml version="...', '', '#', 1, 0)
#0 [internal function]: XSoapClient->__doRequest('<?xml version="...', '', '#', 1, false)
#1 %sbug54911.php(8): SoapClient->__soapCall('', Array)
#2 {main}
thrown in %sbug54911.php on line 4