mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-05-02 02:09:10 -05:00
validate/clean inverse relation name in promoted attr definition
This commit is contained in:
@@ -20,7 +20,7 @@ function parse(value) {
|
||||
else if (token.startsWith('inverse')) {
|
||||
const chunks = token.split('=');
|
||||
|
||||
defObj.inverseRelation = chunks[1];
|
||||
defObj.inverseRelation = chunks[1].replace(/[^\p{L}\p{N}_:]/ug, "")
|
||||
}
|
||||
else {
|
||||
console.log("Unrecognized attribute definition token:", token);
|
||||
|
||||
@@ -298,6 +298,10 @@ function normalize(str) {
|
||||
return removeDiacritic(str).toLowerCase();
|
||||
}
|
||||
|
||||
function filterAttributeName(name) {
|
||||
return name.replace(/[^\p{L}\p{N}_:]/ug, "");
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
randomSecureToken,
|
||||
randomString,
|
||||
@@ -331,5 +335,6 @@ module.exports = {
|
||||
timeLimit,
|
||||
deferred,
|
||||
removeDiacritic,
|
||||
normalize
|
||||
normalize,
|
||||
filterAttributeName
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user