client/tags: escape dots in search term and don't allow '.' and '..' as tags
This commit is contained in:
parent
7c37734fec
commit
4ce72fa712
2 changed files with 3 additions and 2 deletions
|
@ -163,7 +163,8 @@ class TagInputControl extends events.EventTarget {
|
||||||
|
|
||||||
addTagByName(name, source) {
|
addTagByName(name, source) {
|
||||||
name = name.trim();
|
name = name.trim();
|
||||||
if (!name) {
|
// Tags `.` and `..` are not allowed, see https://github.com/rr-/szurubooru/pull/390
|
||||||
|
if (!name || name == "." || name == "..") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return Tag.get(name).then(
|
return Tag.get(name).then(
|
||||||
|
|
|
@ -187,7 +187,7 @@ function arraysDiffer(source1, source2, orderImportant) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function escapeSearchTerm(text) {
|
function escapeSearchTerm(text) {
|
||||||
return text.replace(/([a-z_-]):/g, "$1\\:");
|
return text.replace(/([a-z_-]):/g, "$1\\:").replace(/\./g, "\\.");
|
||||||
}
|
}
|
||||||
|
|
||||||
function dataURItoBlob(dataURI) {
|
function dataURItoBlob(dataURI) {
|
||||||
|
|
Loading…
Reference in a new issue