Skip to content

Ensure we ignore the case of the answer - #51

Merged
WyriHaximus merged 2 commits into
reactphp:masterfrom
WyriHaximus-labs:fix-ucfirst-cname-filter-failure
Mar 2, 2017
Merged

Ensure we ignore the case of the answer#51
WyriHaximus merged 2 commits into
reactphp:masterfrom
WyriHaximus-labs:fix-ucfirst-cname-filter-failure

Conversation

@WyriHaximus

@WyriHaximusWyriHaximus commented Feb 22, 2017

Copy link
Copy Markdown
Member

Came across this while working on #52, testing it against blog.wyrihaximus.net (which is a CNAME for my blog hosted on amazon cloudfront) yielded Blog.wyrihaximus.net as answer. The filter used in the resolver is case sensitive, this PR ensure's it isn't.

@WyriHaximus
WyriHaximus requested review from clue and jsorFebruary 22, 2017 21:14

@clueclue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice find, which milestone should this target? 👍

Comment threadsrc/Resolver/Resolver.php Outdated
{
return array_filter($answers, function ($answer) use ($field, $value) {
return $value === $answer->$field;
return strtolower($value) === strtolower($answer->$field);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Minor optimization: The left hand could probably be moved out of this callback.

@WyriHaximus

Copy link
Copy Markdown
MemberAuthor

@clue next release makes most sense to me to set it to v0.4.5

@WyriHaximus
WyriHaximus merged commit 4647d86 into reactphp:masterMar 2, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@WyriHaximus@jsor@clue