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:
parent
5350af22ba
commit
4be9257efa
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue