Skip to content

Commit 376b38c

Browse files
authored
Merge pull request #4 from dacoto/develop
Add double TLD domains. Thanks @jonathandey
2 parents a09dc1e + db9dc0a commit 376b38c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Validator/Domain.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function passes($attribute, $value): bool
2323
return true;
2424
}
2525

26-
return (bool) preg_match('/^(?:[a-z0-9](?:[a-z0-9-æøå]{0,61}[a-z0-9])?\.)+.[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$/isu', $value);
26+
return (bool) preg_match('/^(?:[a-z0-9](?:[a-z0-9-æøå]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$/isu', $value);
2727
}
2828

2929
/**

tests/DomainTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function testPasses(): void
2020
{
2121
self::assertTrue($this->validator->passes('domain', 'dacoto.com'));
2222
self::assertTrue($this->validator->passes('domain', 'www.dacoto.com'));
23+
self::assertTrue($this->validator->passes('domain', 'hello.world.io'));
2324
}
2425

2526
public function testFails(): void

0 commit comments

Comments
 (0)