[BUGFIX] Avoid exception when validating FQCN 04/37804/4
authorAndreas Allacher <andreas.allacher@gmx.at>
Fri, 13 Mar 2015 06:44:20 +0000 (07:44 +0100)
committerAndreas Fernandez <typo3@scripting-base.de>
Fri, 8 May 2015 09:39:22 +0000 (11:39 +0200)
Strip the leading backslash of the fully qualified classname to avoid the
exception "1420281366" when using @validate.

Change-Id: I80d7ec8904acfa4c309990fd397ec7a015af8d77
Resolves: #65709
Releases: master
Reviewed-on: http://review.typo3.org/37804
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php

index 6321470..c95eee3 100644 (file)
@@ -440,6 +440,9 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface {
                         // Full qualified
                         // Tx_MyExt_Validation_Validator_MyValidator or \Acme\Ext\Validation\Validator\FooValidator
                        $possibleClassName = $validatorName;
+                       if (!empty($possibleClassName) && $possibleClassName[0] === '\\') {
+                               $possibleClassName = substr($possibleClassName, 1);
+                       }
                }
 
                if (substr($possibleClassName, - strlen('Validator')) !== 'Validator') {