Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #49: Converts the matched term to lower case before detecting the used mechanism. #50

Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Model/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getTerms(): iterable
}
$cidr4 = array_key_exists('cidr4', $matches) && $matches['cidr4'] !== '' ? intval($matches['cidr4']) : null;
$cidr6 = array_key_exists('cidr6', $matches) && $matches['cidr6'] !== '' ? intval($matches['cidr6']) : null;
switch($matches['term']) {
switch(strtolower($matches['term'])) {
case Mechanism::ALL:
yield new All($term, $matches['qualifier']);
break;
Expand Down
16 changes: 16 additions & 0 deletions tests/issue49/issue49-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
description: Issue 49
tests:
include-permerror:
description: >-
Accept different upper and lower case mechanisms
helo: mail.example.net
host: 127.0.0.1
mailfrom: [email protected]
result: pass
zonedata:
example.com:
- SPF: 'v=spf1 iP4:127.0.0.1 ~aLL'
example.net:
- SPF: 'v=spf1 +All'
example.org:
- SPF: 'v=spf1 +IP4:127.0.0.1 -ALL'