Skip to content

Commit 788abb8

Browse files
committed
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).
1 parent 32d128d commit 788abb8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/soap/soap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,7 @@ PHP_METHOD(SoapClient, __setLocation)
28862886
zval *tmp;
28872887
zval *this_ptr = ZEND_THIS;
28882888

2889-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &location, &location_len) == FAILURE) {
2889+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!", &location, &location_len) == FAILURE) {
28902890
RETURN_THROWS();
28912891
}
28922892

ext/soap/soap.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,5 @@ public function __getCookies() {}
108108
public function __setSoapHeaders($headers = null) {}
109109

110110
/** @return string|null */
111-
public function __setLocation(string $location = "") {}
111+
public function __setLocation(?string $location = null) {}
112112
}

0 commit comments

Comments
 (0)