mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-20 04:50:03 +00:00
Allow tilde character in bag and recipe names
This commit is contained in:
parent
85607f7846
commit
51e646690c
@ -45,7 +45,8 @@ SqlTiddlerStore.prototype.validateItemName = function(name) {
|
|||||||
if(name.length > 256) {
|
if(name.length > 256) {
|
||||||
return "Too long";
|
return "Too long";
|
||||||
}
|
}
|
||||||
if(!(/^[^\s\u00A0\x00-\x1F\x7F~`!@#$%^&*()+={}\[\];:\'\"<>.,\/\\\?]+$/g.test(name))) {
|
// Removed ~ from this list temporarily
|
||||||
|
if(!(/^[^\s\u00A0\x00-\x1F\x7F`!@#$%^&*()+={}\[\];:\'\"<>.,\/\\\?]+$/g.test(name))) {
|
||||||
return "Invalid character(s)";
|
return "Invalid character(s)";
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -156,8 +157,6 @@ SqlTiddlerStore.prototype.listBags = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SqlTiddlerStore.prototype.createBag = function(bagname,description) {
|
SqlTiddlerStore.prototype.createBag = function(bagname,description) {
|
||||||
console.log(`create bag method for ${bagname} with ${description}`)
|
|
||||||
console.log(`validation results are ${this.validateItemName(bagname)}`)
|
|
||||||
const validationBagName = this.validateItemName(bagname);
|
const validationBagName = this.validateItemName(bagname);
|
||||||
if(validationBagName) {
|
if(validationBagName) {
|
||||||
return {message: validationBagName};
|
return {message: validationBagName};
|
||||||
@ -179,8 +178,6 @@ SqlTiddlerStore.prototype.listRecipes = function() {
|
|||||||
Returns null on success, or {message:} on error
|
Returns null on success, or {message:} on error
|
||||||
*/
|
*/
|
||||||
SqlTiddlerStore.prototype.createRecipe = function(recipename,bagnames,description) {
|
SqlTiddlerStore.prototype.createRecipe = function(recipename,bagnames,description) {
|
||||||
console.log(`create recipe method for ${recipename} with ${JSON.stringify(bagnames)}`)
|
|
||||||
console.log(`validation results are ${this.validateItemName(recipename)} and ${this.validateItemNames(bagnames)}`)
|
|
||||||
bagnames = bagnames || [];
|
bagnames = bagnames || [];
|
||||||
description = description || "";
|
description = description || "";
|
||||||
const validationRecipeName = this.validateItemName(recipename);
|
const validationRecipeName = this.validateItemName(recipename);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user