Skip to content
Snippets Groups Projects
Commit e3929f17 authored by tbrehm's avatar tbrehm
Browse files

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

parent b6ff2e1b
No related branches found
No related tags found
No related merge requests found
......@@ -109,6 +109,10 @@ $form["tabs"]['filter'] = array (
'target' => array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'REGEX',
'regex' => '/^[a-zA-Z0-9\.\-\_]{0,100}$/',
'errmsg'=> 'target_error_regex'),
),
'default' => '',
'value' => '',
'width' => '30',
......
......@@ -6,4 +6,5 @@ $wb["active_txt"] = 'Active';
$wb["rulename_error_empty"] = 'Name is empty.';
$wb["searchterm_is_empty"] = 'Search term is empty.';
$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 {
// Set the 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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment