Skip to content

Commit 7a03f0e

Browse files
authored
Converts the matched term to lower case before detecting the used mechanism. (#50)
Fixes #49
1 parent 03bdf80 commit 7a03f0e

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/Model/Record.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getTerms(): iterable
5555
}
5656
$cidr4 = array_key_exists('cidr4', $matches) && $matches['cidr4'] !== '' ? intval($matches['cidr4']) : null;
5757
$cidr6 = array_key_exists('cidr6', $matches) && $matches['cidr6'] !== '' ? intval($matches['cidr6']) : null;
58-
switch($matches['term']) {
58+
switch(strtolower($matches['term'])) {
5959
case Mechanism::ALL:
6060
yield new All($term, $matches['qualifier']);
6161
break;

tests/issue49/issue49-tests.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
description: Issue 49
2+
tests:
3+
include-permerror:
4+
description: >-
5+
Accept different upper and lower case mechanisms
6+
helo: mail.example.net
7+
host: 127.0.0.1
8+
9+
result: pass
10+
zonedata:
11+
example.com:
12+
- SPF: 'v=spf1 iP4:127.0.0.1 ~aLL'
13+
example.net:
14+
- SPF: 'v=spf1 +All'
15+
example.org:
16+
- SPF: 'v=spf1 +IP4:127.0.0.1 -ALL'

0 commit comments

Comments
 (0)