diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-10 10:50:42 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-10 10:50:42 +0100 |
commit | 788abb8cc818dc86c1ca7b505064edf88dc65b33 (patch) | |
tree | c091541d51e466b8d3c8a57a94f29631e0a3dbe4 | |
parent | 32d128d219f2d2d0767103091b4209a28f48b4ac (diff) | |
download | php-git-788abb8cc818dc86c1ca7b505064edf88dc65b33.tar.gz |
Accept null $location in SoapClient::__setLocation()
Currently an empty string is used to unset the location. Once
again, it makes more sense to use a null value for this purpose
(though the special behavior of empty strings is retained).
The code comment above the function also explicitly indicates
that null should be accepted, and the function does return null
rather than an empty string for the old location value (if it
is missing).
-rw-r--r-- | ext/soap/soap.c | 2 | ||||
-rw-r--r-- | ext/soap/soap.stub.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 82657caad6..3334689ed9 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2886,7 +2886,7 @@ PHP_METHOD(SoapClient, __setLocation) zval *tmp; zval *this_ptr = ZEND_THIS; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &location, &location_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!", &location, &location_len) == FAILURE) { RETURN_THROWS(); } diff --git a/ext/soap/soap.stub.php b/ext/soap/soap.stub.php index 298374e866..01e41b7e87 100644 --- a/ext/soap/soap.stub.php +++ b/ext/soap/soap.stub.php @@ -108,5 +108,5 @@ class SoapClient public function __setSoapHeaders($headers = null) {} /** @return string|null */ - public function __setLocation(string $location = "") {} + public function __setLocation(?string $location = null) {} } |