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:
@@ -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)
|
||||
{
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user