You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fatal error: Uncaught ValueError: SoapHeader::__construct(): Argument #2 ($name) must be longer than 2 characters in /home/user/scripts/code.php:4
But I expected this output instead:
Fatal error: Uncaught ValueError: SoapHeader::__construct(): Argument #5 ($actor) must be longer than 2 characters in /home/user/scripts/code.php:4
2803c8f added a check in file ext/soap/soap.c on the SoapHeader constructor which checks that the length of actor is greater than 2 when it is a string. However, the error is thrown on parameter 2 ($name) instead of being thrown on parameter 5 ($actor):
Besides the error being thrown on the wrong parameter number, is there a specific reason of adding a minimum length of 2 on the actor string?
It seems to me that has been inadvertently changed. Prior to PHP 8.0.0, the only requirement was that the actor string is not empty. Maybe @kocsismate remembers if there was a reason to change that? On the other hand, the actor is supposed to be an URI, so even an artificial requirement of more than two characters shouldn't be a problem.
Activity
cmb69 commentedon May 19, 2022
Ah, good catch. Thank you!
It seems to me that has been inadvertently changed. Prior to PHP 8.0.0, the only requirement was that the actor string is not empty. Maybe @kocsismate remembers if there was a reason to change that? On the other hand, the actor is supposed to be an URI, so even an artificial requirement of more than two characters shouldn't be a problem.
Fix GH-8578: Error on wrong parameter on SoapHeader constructor
Merge branch 'PHP-8.0' into PHP-8.1
Merge branch 'PHP-8.1'