From 91e13c4287ece777d65b3a19ce5ee23eabe4782f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wit=E3=80=86=E8=8B=97=E5=A4=A7?= <38201220+WitMiao@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:56:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(is.ts):=20fix#2028=20=E4=BF=AE=E5=A4=8DisUr?= =?UTF-8?q?l=E6=AD=A3=E5=88=99=E5=8F=AF=E4=BB=A5=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E5=88=B0/www=E9=97=AE=E9=A2=98=20(#2033)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 苗大 --- src/utils/is.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/is.ts b/src/utils/is.ts index d71fd9b65..04803cff1 100644 --- a/src/utils/is.ts +++ b/src/utils/is.ts @@ -94,6 +94,6 @@ export const isClient = !isServer; export function isUrl(path: string): boolean { const reg = - /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/; + /^(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/; return reg.test(path); }