diff --git a/composer.json b/composer.json index a447bba..aa02c05 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "alexrsagen/obie", - "version": "1.6.8", + "version": "1.6.9", "type": "framework", "description": "Obie is a simple PHP framework. It aims to provide basic services needed for any web app.", "keywords": ["framework", "php", "http", "template", "view", "router", "routing", "model", "models", "session", "sessions"], diff --git a/src/ip/cidr.php b/src/ip/cidr.php index a7c3ecb..c40553f 100644 --- a/src/ip/cidr.php +++ b/src/ip/cidr.php @@ -157,6 +157,16 @@ public static function fromSpf1RecordLookup(string $dns_name, int &$max_dns_look $record = Spf1::decode($txt_record['txt']); if (!$record) continue; + // set to ($dns_name) if not explicitly specified + foreach ($record->directives as $directive) { + if (strlen($directive->value) === 0 && in_array($directive->mechanism, [ + Spf1::MECHANISM_A, + Spf1::MECHANISM_MX, + ])) { + $directive->value = $dns_name; + } + } + return static::fromSpf1Record($record, $max_dns_lookup, $max_dns_mx_host_lookup); }