2 namespace TYPO3\CMS\Form\Domain\Validator;
23 'element' => array(
'',
'The name of the element',
'string',
true),
24 'errorMessage' => array(
'',
'The error message',
'array',
true),
25 'allowWhiteSpace' => array(
'',
'Whitespaces are allowed',
'boolean',
false),
45 !isset($this->options[
'allowWhiteSpace'])
46 || $this->options[
'allowWhiteSpace'] ===
''
47 || (
int)$this->options[
'allowWhiteSpace'] === 0
49 $this->options[
'allowWhiteSpace'] =
false;
51 $this->options[
'allowWhiteSpace'] =
true;
54 $whiteSpace = $this->options[
'allowWhiteSpace'] ?
'\\s' :
'';
55 $pattern =
'/[^\pL' . $whiteSpace .
']/u';
56 $compareValue = preg_replace($pattern,
'', (
string)$value);
58 if ($compareValue !== $value) {
61 $this->options[
'errorMessage'][0],
62 $this->options[
'errorMessage'][1],
80 $label = static::LOCALISATION_OBJECT_NAME .
'.message';
81 $messages[] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($label,
'form');
82 if ($this->options[
'allowWhiteSpace']) {
83 $messages[] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($label . 2,
'form');
85 $message = implode(
', ', $messages);