diff --git a/application/forms/Config/Authentication/ExternalBackendForm.php b/application/forms/Config/Authentication/ExternalBackendForm.php index e25661596..86087eb66 100644 --- a/application/forms/Config/Authentication/ExternalBackendForm.php +++ b/application/forms/Config/Authentication/ExternalBackendForm.php @@ -53,7 +53,7 @@ class ExternalBackendForm extends Form return @preg_match($value, '') !== false; }); $callbackValidator->setMessage( - $this->translate('"%value%" is not a valid regular expression'), + $this->translate('"%value%" is not a valid regular expression.'), Zend_Validate_Callback::INVALID_VALUE ); $this->addElement( @@ -62,9 +62,10 @@ class ExternalBackendForm extends Form array( 'label' => $this->translate('Filter Pattern'), 'description' => $this->translate( - 'The regular expression to use to strip specific parts off from usernames.' - . ' Leave empty if you do not want to strip off anything' + 'The filter to use to strip specific parts off from usernames.' + . ' Leave empty if you do not want to strip off anything.' ), + 'requirement' => $this->translate('The filter pattern must be a valid regular expression.'), 'validators' => array($callbackValidator) ) ); diff --git a/application/forms/Config/General/LoggingConfigForm.php b/application/forms/Config/General/LoggingConfigForm.php index 1c4e090c4..bd62f4490 100644 --- a/application/forms/Config/General/LoggingConfigForm.php +++ b/application/forms/Config/General/LoggingConfigForm.php @@ -66,6 +66,7 @@ class LoggingConfigForm extends Form 'description' => $this->translate( 'The name of the application by which to prefix syslog messages.' ), + 'requirement' => $this->translate('The application prefix must not contain whitespace.'), 'value' => 'icingaweb2', 'validators' => array( array( diff --git a/application/forms/Config/Resource/FileResourceForm.php b/application/forms/Config/Resource/FileResourceForm.php index b1bb0c6ae..184a5c18a 100644 --- a/application/forms/Config/Resource/FileResourceForm.php +++ b/application/forms/Config/Resource/FileResourceForm.php @@ -3,6 +3,7 @@ namespace Icinga\Forms\Config\Resource; +use Zend_Validate_Callback; use Icinga\Web\Form; /** @@ -42,13 +43,22 @@ class FileResourceForm extends Form 'validators' => array('ReadablePathValidator') ) ); + $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( 'text', 'fields', array( 'required' => true, 'label' => $this->translate('Pattern'), - 'description' => $this->translate('The regular expression by which to identify columns') + 'description' => $this->translate('The pattern by which to identify columns.'), + 'requirement' => $this->translate('The column pattern must be a valid regular expression.'), + 'validators' => array($callbackValidator) ) );