simplesamlphp / saml2

SimpleSAMLphp low-level SAML2 PHP library
https://www.simplesamlphp.org
GNU Lesser General Public License v2.1
286 stars 135 forks source link

SoapClient send() gives Fatal Error: Undefined constant SoapClient::SOAP_1_1 #294

Closed FredKegel closed 2 years ago

FredKegel commented 2 years ago

When processing an Artifact through the HTTP Artifact binding, SAML2/SOAPClient builds a SoapClient from the global namespace and tries to set the SOAP version on line 134 using a class constant:

$version = BUILTIN_SoapClient::SOAP_1_1;

However, this throws a fatal error since this constant isn't defined in the global class SoapClient. It's a predefined constant which is defined by the extension itself (https://www.php.net/manual/en/soap.constants.php) Actually all the SOAP_* constants are predefined.

This is due to commit 4f5479eaaebf6c23302cc77a5594b1d6f1373ca3 (Fix several Psalm-issues) where an alias was added at the top of the file:

use SoapClient as BUILTIN_SoapClient;

Before (prior to 4.2.8) the SOAP version was set with the predefined constant.

tvdijen commented 2 years ago

Hi @FredKegel ! I've just tagged v4.5.1 to fix this.. Please let me know if the issue is resolved.

FredKegel commented 2 years ago

Hi Tim,

Thanks for the quick resolution. I can confirm your fix resolves the issue, so it can be closed.