[BUGFIX] Alphanumeric validator fails with broken PCRE
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 26 Jan 2013 19:20:56 +0000 (20:20 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 26 Jan 2013 20:29:18 +0000 (21:29 +0100)
After change from #44216 the alphanumeric filter fails on
systems like debian squeeze with PHP 5.3.3 due to a broken
PCRE environment.

Change-Id: I349385c13c5b9757d879d483ec7e625501e32e88
Resolves: #44832
Related: #44216
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/17734
Reviewed-by: Wouter Wolters
Reviewed-by: Daniel Hürtgen
Tested-by: Daniel Hürtgen
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/extbase/Classes/Validation/Validator/AlphanumericValidator.php

index 345d695..4fcbca2 100644 (file)
@@ -43,7 +43,7 @@ class AlphanumericValidator extends \TYPO3\CMS\Extbase\Validation\Validator\Abst
         */
        public function isValid($value) {
                $this->errors = array();
-               if (!is_string($value) || preg_match('/^[[:alnum:]]*$/u', $value) !== 1) {
+               if (!is_string($value) || preg_match('/^[\pL\d]*$/u', $value) !== 1) {
                        $this->addError('The given subject was not a valid alphanumeric string.', 1221551320);
                        return FALSE;
                }