Fix email domain validation
This commit is contained in:
parent
7501b2c135
commit
f4476ba55f
@ -31,7 +31,10 @@ type SocialIconProps = {
|
||||
}
|
||||
|
||||
const SocialIcon = ({ kind, href, size = 8 }: SocialIconProps) => {
|
||||
if (!href || (kind === 'mail' && !/^mailto:\w+([.-]?\w+)@\w+([.-]?\w+)(.\w{2,3})+$/.test(href)))
|
||||
if (
|
||||
!href ||
|
||||
(kind === 'mail' && !/^mailto:[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(href))
|
||||
)
|
||||
return null
|
||||
|
||||
const SocialSvg = components[kind]
|
||||
|
Loading…
x
Reference in New Issue
Block a user