Fixed #249
This commit is contained in:
parent
01016337ec
commit
68f40bd86c
1 changed files with 3 additions and 3 deletions
|
@ -27,16 +27,16 @@ class NotLocalRecipient implements Rule
|
||||||
*/
|
*/
|
||||||
public function passes($attribute, $value)
|
public function passes($attribute, $value)
|
||||||
{
|
{
|
||||||
$emailDomain = Str::afterLast($value, '@');
|
$emailDomain = strtolower(Str::afterLast($value, '@'));
|
||||||
|
|
||||||
// Make sure the recipient domain is not added as a verified custom domain
|
// Make sure the recipient domain is not added as a verified custom domain
|
||||||
if (Domain::whereNotNull('domain_verified_at')->pluck('domain')->contains(strtolower($emailDomain))) {
|
if (Domain::whereNotNull('domain_verified_at')->pluck('domain')->contains($emailDomain)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = collect(config('anonaddy.all_domains'))
|
$count = collect(config('anonaddy.all_domains'))
|
||||||
->filter(function ($domain) use ($emailDomain) {
|
->filter(function ($domain) use ($emailDomain) {
|
||||||
return Str::endsWith(strtolower($emailDomain), $domain);
|
return $domain === $emailDomain || Str::endsWith($emailDomain, '.' . $domain);
|
||||||
})
|
})
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue