1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-31 03:10:19 +02:00

v2.13 allow dots in page names

This commit is contained in:
trendschau
2025-01-16 22:17:10 +01:00
parent 23b55a0b27
commit 363d6371f3
2 changed files with 15 additions and 8 deletions

View File

@@ -127,13 +127,15 @@ class Validation
Validator::addRule('navigation', function($field, $value, array $params, array $fields)
{
$format = '/[@#^*()=\[\]{};:"\\|,.<>\/]/';
if ( preg_match($format, $value))
# $format = '/[@#^*()=\[\]{};:"\\|,.<>\/]/';
$format = '/^(?![ .])[^\0\/\\?%*:|"<>]+(?<![ .])$|^(?![ .])[^\0\/\\?%*:|"<>]+[!?]$/';
if ( preg_match($format, $value) === 1)
{
return false;
return true;
}
return true;
}, 'contains special characters');
return false;
}, 'contains invalid characters or patterns');
Validator::addRule('noSpecialChars', function($field, $value, array $params, array $fields)
{

View File

@@ -223,7 +223,8 @@ navigation.component('navilevel',{
load: '?',
freeze: false,
newItem: '',
format: /[@#*()=\[\]{};:"\\|,.<>\/]/,
/* format: /[@#*()=\[\]{};:"\\|,.<>\/]/, */
format: /(^\.)|(\.$)|[\/\\?%*:|"<>]/,
}
},
computed:
@@ -400,9 +401,13 @@ navigation.component('navilevel',{
{
eventBus.$emit('publisherclear');
if( this.format.test(this.newItem) || !this.newItem || this.newItem.length > 40)
if(
this.format.test(this.newItem) ||
!this.newItem ||
this.newItem.length > 60
)
{
let message = this.$filters.translate('Special Characters are not allowed. Length between 1 and 40.');
let message = this.$filters.translate('Special characters or invalid patterns are not allowed. Length between 1 and 60.');
eventBus.$emit('publishermessage', message);
return;
}