Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Fix case-sensitivity in discovery #134

Merged
merged 2 commits into from
Jan 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions Auth/OpenID/Parse.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,10 @@ function removeQuotes($str)

function match($regexp, $text, &$match)
{
if (!is_callable('mb_ereg_search_init')) {
if (!preg_match($regexp, $text, $match)) {
return false;
}
$match = $match[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned with removing this. preg_match returns an array the first element is the whole line, the second element is the text capture from $regexp. The purpose of this method is to just return the first line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did my comment #134 (comment) address your concern ? You can check by yourself that it is expected that the match function returns an array, at least from the function used to extract links (openid rel) from the page.

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;
}

/**
Expand Down