Skip to content

Commit 9e32e13

Browse files
committed
Accept bool in SoapClient::__doRequest
$one_way is a boolean argument.
1 parent d3b41c4 commit 9e32e13

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

ext/soap/soap.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,7 +2188,7 @@ PHP_METHOD(SoapClient, __construct)
21882188
}
21892189
/* }}} */
21902190

2191-
static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, int one_way, zval *response) /* {{{ */
2191+
static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *action, int version, zend_bool one_way, zval *response) /* {{{ */
21922192
{
21932193
int ret = TRUE;
21942194
char *buf;
@@ -2226,7 +2226,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
22262226
ZVAL_STRING(&params[2], action);
22272227
}
22282228
ZVAL_LONG(&params[3], version);
2229-
ZVAL_LONG(&params[4], one_way);
2229+
ZVAL_BOOL(&params[4], one_way);
22302230

22312231
if (call_user_function(NULL, this_ptr, &func, response, 5, params) != SUCCESS) {
22322232
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,
23612361
fn = get_function(sdl, function);
23622362
if (fn != NULL) {
23632363
sdlBindingPtr binding = fn->binding;
2364-
int one_way = 0;
2364+
zend_bool one_way = 0;
23652365

23662366
if (fn->responseName == NULL &&
23672367
fn->responseParameters == NULL &&
@@ -2758,10 +2758,10 @@ PHP_METHOD(SoapClient, __doRequest)
27582758
char *location, *action;
27592759
size_t location_size, action_size;
27602760
zend_long version;
2761-
zend_long one_way = 0;
2761+
zend_bool one_way = 0;
27622762
zval *this_ptr = ZEND_THIS;
27632763

2764-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sssl|l",
2764+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sssl|b",
27652765
&buf,
27662766
&location, &location_size,
27672767
&action, &action_size,

ext/soap/soap.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function __getLastRequestHeaders() {}
9393
public function __getLastResponseHeaders() {}
9494

9595
/** @return string|null */
96-
public function __doRequest(string $request, string $location, string $action, int $version, int $one_way = 0) {}
96+
public function __doRequest(string $request, string $location, string $action, int $version, bool $one_way = false) {}
9797

9898
/** @return void */
9999
public function __setCookie(string $name, ?string $value = null) {}

ext/soap/soap_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: b33d57ddba20c64739d51bfba39f2557026939cd */
2+
* Stub hash: 6cba3704e7a71fa22031734207365dd88764ddb2 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_use_soap_error_handler, 0, 0, _IS_BOOL, 0)
55
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)
116116
ZEND_ARG_TYPE_INFO(0, location, IS_STRING, 0)
117117
ZEND_ARG_TYPE_INFO(0, action, IS_STRING, 0)
118118
ZEND_ARG_TYPE_INFO(0, version, IS_LONG, 0)
119-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, one_way, IS_LONG, 0, "0")
119+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, one_way, _IS_BOOL, 0, "false")
120120
ZEND_END_ARG_INFO()
121121

122122
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapClient___setCookie, 0, 0, 1)

ext/soap/tests/bugs/bug54911.phpt

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

0 commit comments

Comments
 (0)