From 651a1ba073561825d7b6f379a91f44bb25c0215d Mon Sep 17 00:00:00 2001 From: James Chang Date: Sun, 10 Oct 2021 15:56:15 -0400 Subject: [PATCH] Fix imageUrl scalar regex check to allow parentheses --- backend/functions/src/schema/scalars/imageUrl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/functions/src/schema/scalars/imageUrl.ts b/backend/functions/src/schema/scalars/imageUrl.ts index 2a5b9db..6ef7dd9 100644 --- a/backend/functions/src/schema/scalars/imageUrl.ts +++ b/backend/functions/src/schema/scalars/imageUrl.ts @@ -6,7 +6,7 @@ function validate(value) { "^(https?:\\/\\/)?" + // protocol "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|" + // domain name "((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address - "(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path + "(\\:\\d+)?(\\/[-a-z\\d%_.~+\\(\\)]*)*" + // port and path "(\\?[;&a-z\\d%_.~+=-]*)?" + // query string "(\\#[-a-z\\d_]*)?$", "i"