mirror of
https://github.com/makeplane/plane.git
synced 2026-02-14 18:58:45 -06:00
[WEB-2605] fix: update URL regex pattern to allow complex links. (#5767)
This commit is contained in:
@@ -270,7 +270,7 @@ export const isCommentEmpty = (comment: string | undefined): boolean => {
|
||||
export const checkURLValidity = (url: string): boolean => {
|
||||
if (!url) return false;
|
||||
// regex to match valid URLs (with or without http/https)
|
||||
const urlPattern = /^(https?:\/\/)?([\da-z.-]+)\.([a-z]{2,6})(\/[\w.-]*)*\/?(\?[=&\w.-]*)?$/i;
|
||||
const urlPattern = /^(https?:\/\/)?([\w.-]+\.[a-z]{2,6})(\/[\w\-.~:/?#[\]@!$&'()*+,;=%]*)?$/i;
|
||||
// test if the URL matches the pattern
|
||||
return urlPattern.test(url);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user