Validate that normal tags don't contain '&' as value
This commit is contained in:
parent
d919fb6fa9
commit
2765b1a73e
1 changed files with 4 additions and 0 deletions
|
@ -18,6 +18,10 @@ export class Tag extends TagsFilter {
|
||||||
if (value === "*") {
|
if (value === "*") {
|
||||||
console.warn(`Got suspicious tag ${key}=* ; did you mean ${key}~* ?`)
|
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(', ')}]}'`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue