diff --git a/application/forms/BpConfigForm.php b/application/forms/BpConfigForm.php index b1847f8..2a65b45 100644 --- a/application/forms/BpConfigForm.php +++ b/application/forms/BpConfigForm.php @@ -23,12 +23,19 @@ class BpConfigForm extends BpConfigBaseForm 'max' => 40 ) ), - array( + [ 'validator' => 'Regex', - 'options' => array( - 'pattern' => '/^[a-zA-Z0-9](?:[a-zA-Z0-9 ._-]*)?[a-zA-Z0-9_]$/' - ) - ) + 'options' => [ + 'pattern' => '/^[a-zA-Z0-9](?:[\w\h._-]*)?\w$/', + 'messages' => [ + 'regexNotMatch' => $this->translate( + 'Id must only consist of alphanumeric characters.' + . ' Underscore at the beginning and space, dot and hyphen at the beginning' + . ' and end are not allowed.' + ) + ] + ] + ] ), 'description' => $this->translate( 'This is the unique identifier of this process' diff --git a/application/forms/BpUploadForm.php b/application/forms/BpUploadForm.php index 5d97860..af4af43 100644 --- a/application/forms/BpUploadForm.php +++ b/application/forms/BpUploadForm.php @@ -49,12 +49,19 @@ class BpUploadForm extends BpConfigBaseForm 'max' => 40 ) ), - array( + [ 'validator' => 'Regex', - 'options' => array( - 'pattern' => '/^[a-zA-Z0-9](?:[a-zA-Z0-9 ._-]*)?[a-zA-Z0-9_]$/' - ) - ) + 'options' => [ + 'pattern' => '/^[a-zA-Z0-9](?:[\w\h._-]*)?\w$/', + 'messages' => [ + 'regexNotMatch' => $this->translate( + 'Id must only consist of alphanumeric characters.' + . ' Underscore at the beginning and space, dot and hyphen at the beginning' + . ' and end are not allowed.' + ) + ] + ] + ] ), ));