From 2765b1a73e216fe95029fd19c30a8bb7a726de77 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sat, 3 Sep 2022 20:31:54 +0200 Subject: [PATCH] Validate that normal tags don't contain '&' as value --- Logic/Tags/Tag.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Logic/Tags/Tag.ts b/Logic/Tags/Tag.ts index 803b79390..005fa95ba 100644 --- a/Logic/Tags/Tag.ts +++ b/Logic/Tags/Tag.ts @@ -18,6 +18,10 @@ export class Tag extends TagsFilter { if (value === "*") { console.warn(`Got suspicious tag ${key}=* ; did you mean ${key}~* ?`) } + if(value.indexOf("&") >= 0){ + const tags = (key + "="+value).split("&") + throw `Invalid value for a tag: it contains '&'. You probably meant to use '{"and":[${tags.map(kv => "\"" + kv +"\"").join(', ')}]}'` + } }