parent
6c70a53309
commit
c06f015210
|
@ -40,13 +40,22 @@ class ExternalBackendForm extends Form
|
||||||
array(
|
array(
|
||||||
'pattern' => '/^[^\\[\\]:]+$/',
|
'pattern' => '/^[^\\[\\]:]+$/',
|
||||||
'messages' => array(
|
'messages' => array(
|
||||||
'regexNotMatch' => 'The backend name cannot contain \'[\', \']\' or \':\'.'
|
'regexNotMatch' => $this->translate(
|
||||||
|
'The backend name cannot contain \'[\', \']\' or \':\'.'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$callbackValidator = new Zend_Validate_Callback(function ($value) {
|
||||||
|
return @preg_match($value, '') !== false;
|
||||||
|
});
|
||||||
|
$callbackValidator->setMessage(
|
||||||
|
$this->translate('"%value%" is not a valid regular expression'),
|
||||||
|
Zend_Validate_Callback::INVALID_VALUE
|
||||||
|
);
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
'text',
|
'text',
|
||||||
'strip_username_regexp',
|
'strip_username_regexp',
|
||||||
|
@ -56,11 +65,7 @@ class ExternalBackendForm extends Form
|
||||||
'The regular expression to use to strip specific parts off from usernames.'
|
'The regular expression to use to strip specific parts off from usernames.'
|
||||||
. ' Leave empty if you do not want to strip off anything'
|
. ' Leave empty if you do not want to strip off anything'
|
||||||
),
|
),
|
||||||
'validators' => array(
|
'validators' => array($callbackValidator)
|
||||||
new Zend_Validate_Callback(function ($value) {
|
|
||||||
return @preg_match($value, '') !== false;
|
|
||||||
})
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
|
|
|
@ -74,7 +74,9 @@ class LoggingConfigForm extends Form
|
||||||
array(
|
array(
|
||||||
'pattern' => '/^[^\W]+$/',
|
'pattern' => '/^[^\W]+$/',
|
||||||
'messages' => array(
|
'messages' => array(
|
||||||
'regexNotMatch' => 'The application prefix cannot contain any whitespaces.'
|
'regexNotMatch' => $this->translate(
|
||||||
|
'The application prefix must not contain whitespace.'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue