Validate that normal tags don't contain '&' as value

This commit is contained in:
pietervdvn 2022-09-03 20:31:54 +02:00
parent d919fb6fa9
commit 2765b1a73e

View file

@ -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(', ')}]}'`
}
}