@@ -2,4 +2,6 @@ const urlRegex =
|
||||
/^(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]:[0-9]*\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]:[0-9]*\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})$/
|
||||
|
||||
export const validateUrl = (url: string) =>
|
||||
url.startsWith('http://localhost') || urlRegex.test(url)
|
||||
url.startsWith('http://localhost') ||
|
||||
url.startsWith('http://fake-upload-url.com') ||
|
||||
urlRegex.test(url)
|
||||
|
||||
Reference in New Issue
Block a user