FIX: OpenID server discovery passes the whole HTTP response array as HTML (#39156)

htdocs/core/class/openid.class.php OpenId::GetOpenIDServer() calls:
	$response = getURLContent(...);            // array{http_code,content,...}
	list($servers, $delegates) = $this->HTML2OpenIDServer($response);
but HTML2OpenIDServer($content) runs preg_match_all(..., $content), i.e. it
expects the HTML string, not the whole getURLContent() array. On PHP 8 this
throws a TypeError (preg_match_all subject must be string), breaking OpenID
server discovery; on PHP 7 it silently matches nothing. Pass $response['content'].

PHPStan level 10 flagged: Parameter #1 $content of method
SimpleOpenID::HTML2OpenIDServer() expects string, array given.

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Jam Balaya 2026-07-16 09:07:23 +09:00 committed by GitHub
parent 5350af22ba
commit 4be9257efa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -388,7 +388,7 @@ class SimpleOpenID
$response = getURLContent($url, 'GET', '', 1, array(), array('http', 'https'));
list($servers, $delegates) = $this->HTML2OpenIDServer($response);
list($servers, $delegates) = $this->HTML2OpenIDServer($response['content']);
if (count($servers) == 0) {
$this->ErrorStore('OPENID_NOSERVERSFOUND');
return false;