Skip to content

Commit a2fde6d

Browse files
authored
Merge pull request #948 from timlrx/fix/email-domain
Fix email domain validation
2 parents 7501b2c + f4476ba commit a2fde6d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/social-icons/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ type SocialIconProps = {
3131
}
3232

3333
const SocialIcon = ({ kind, href, size = 8 }: SocialIconProps) => {
34-
if (!href || (kind === 'mail' && !/^mailto:\w+([.-]?\w+)@\w+([.-]?\w+)(.\w{2,3})+$/.test(href)))
34+
if (
35+
!href ||
36+
(kind === 'mail' && !/^mailto:[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(href))
37+
)
3538
return null
3639

3740
const SocialSvg = components[kind]

0 commit comments

Comments
 (0)