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

Conversation

strk
Copy link
Contributor

@strk strk commented Mar 18, 2017

Fixes #133

Copy link
Member

@marcoceppi marcoceppi left a comment

Choose a reason for hiding this comment

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

I don't think this properly addresses the bug and I'm not sure it's exactly what we'd want this method to do.

return true;
}

if ( !is_callable('mb_ereg_search_init')) {
Copy link
Member

Choose a reason for hiding this comment

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

There's no need for this block now. There was never a need for it since preg_match replaced mb_ereg_search a while ago. Just delete this block and replace it with return false;

Copy link
Member

Choose a reason for hiding this comment

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

Also, since you're basically short circuiting the whole method, you can probably just kill lines 229 - 235. If preg_match works as expected.

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.

@strk
Copy link
Contributor Author

strk commented Mar 20, 2017 via email

@strk
Copy link
Contributor Author

strk commented Apr 8, 2017

@marcoceppi did I not address your concern ? I'm using this change in production with PHP-5.6 in case it helps accepting it (btw: no CI keeping an eye on the code?)

@strk
Copy link
Contributor Author

strk commented Apr 8, 2017

For the record: this change was also proposed downstream to GNUSocial (after successfully running it in production for some time now): https://git.gnu.io/gnu/gnu-social/merge_requests/140

@strk
Copy link
Contributor Author

strk commented Apr 21, 2017

@marcoceppi Wordpress plugin is also affected (surely using your library): diso/wordpress-openid#48

mattl pushed a commit to foocorp/gnu-social that referenced this pull request Jul 11, 2017
Closes #60

Equivalent change was proposed upstream:
openid/php-openid#134
@strk
Copy link
Contributor Author

strk commented Jan 9, 2018

@marcoceppi hello ?

@marcoceppi marcoceppi merged commit 8c3a0ae into openid:master Jan 10, 2018
@strk strk deleted the case-sensitive-discovery branch January 10, 2018 11:26
@strk
Copy link
Contributor Author

strk commented Jan 10, 2018

thanks

someonewithpc pushed a commit to someonewithpc/gnusocial that referenced this pull request May 20, 2020
Closes #60

Equivalent change was proposed upstream:
openid/php-openid#134
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants