Commit e3929f17 authored by tbrehm's avatar tbrehm
Browse files

Fixed: FS#998 - Mail filters: Foldernames may not start with a dot

parent b6ff2e1b
...@@ -109,6 +109,10 @@ $form["tabs"]['filter'] = array ( ...@@ -109,6 +109,10 @@ $form["tabs"]['filter'] = array (
'target' => array ( 'target' => array (
'datatype' => 'VARCHAR', 'datatype' => 'VARCHAR',
'formtype' => 'TEXT', 'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[a-zA-Z0-9\.\-\_]{0,100}$/',
'errmsg'=> 'target_error_regex'),
),
'default' => '', 'default' => '',
'value' => '', 'value' => '',
'width' => '30', 'width' => '30',
......
...@@ -6,4 +6,5 @@ $wb["active_txt"] = 'Active'; ...@@ -6,4 +6,5 @@ $wb["active_txt"] = 'Active';
$wb["rulename_error_empty"] = 'Name is empty.'; $wb["rulename_error_empty"] = 'Name is empty.';
$wb["searchterm_is_empty"] = 'Search term is empty.'; $wb["searchterm_is_empty"] = 'Search term is empty.';
$wb["source_txt"] = 'Source'; $wb["source_txt"] = 'Source';
$wb["target_error_regex"] = 'The target may only contain these characters: a-z, 0-9, -, . and _';
?> ?>
\ No newline at end of file
...@@ -62,6 +62,9 @@ class page_action extends tform_actions { ...@@ -62,6 +62,9 @@ class page_action extends tform_actions {
// Set the mailuser_id // Set the mailuser_id
$this->dataRecord["mailuser_id"] = $mailuser["mailuser_id"]; $this->dataRecord["mailuser_id"] = $mailuser["mailuser_id"];
// Remove leading dots
if(substr($this->dataRecord['target'],0,1) == '.') $this->dataRecord['target'] = substr($this->dataRecord['target'],1);
parent::onSubmit(); parent::onSubmit();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment