Fix OpenID discovery in pages using uppercase <HEAD> tag

Closes #60

Equivalent change was proposed upstream:
https://github.com/openid/php-openid/pull/134
This commit is contained in:
Sandro Santilli 2017-04-08 09:13:59 +02:00
parent 6679ecb9d7
commit aac6a21c4e
1 changed files with 3 additions and 13 deletions

View File

@ -218,21 +218,11 @@ class Auth_OpenID_Parse {
function match($regexp, $text, &$match)
{
if (!is_callable('mb_ereg_search_init')) {
if (!preg_match($regexp, $text, $match)) {
return false;
}
$match = $match[0];
return true;
if (preg_match($regexp, $text, $match)) {
return true;
}
$regexp = substr($regexp, 1, strlen($regexp) - 2 - strlen($this->_re_flags));
mb_ereg_search_init($text);
if (!mb_ereg_search($regexp)) {
return false;
}
$match = mb_ereg_search_getregs();
return true;
return false;
}
/**