itemroute fix
This commit is contained in:
@@ -66,6 +66,8 @@ export default new class {
|
||||
return link.join("/");
|
||||
};
|
||||
parseTag(tag) {
|
||||
if(!tag)
|
||||
return null;
|
||||
return tag
|
||||
.replace(/%20/g, " ");
|
||||
}
|
||||
@@ -95,5 +97,13 @@ export default new class {
|
||||
const derivedKey = await scrypt(str, salt, 64);
|
||||
return crypto.timingSafeEqual(keyBuffer, derivedKey);
|
||||
};
|
||||
async getTags(itemid) {
|
||||
const tags = await sql("tags_assign")
|
||||
.leftJoin("tags", "tags.id", "tags_assign.tag_id")
|
||||
.where("tags_assign.item_id", itemid);
|
||||
for(let t = 0; t < tags.length; t++)
|
||||
tags[t].tag = tags[t].tag.replace(/[\u00A0-\u9999<>\&]/g, i => '&#'+i.charCodeAt(0)+';');
|
||||
return tags;
|
||||
};
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user