[BUGFIX] Correctly apply Extbase validator options and add tests
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Validation / ValidatorResolver.php
index 1789e17..3ae876a 100644 (file)
@@ -105,11 +105,7 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface {
                         */
                        $validatorObjectName = $this->resolveValidatorObjectName($validatorType);
 
-                       $validator = $this->objectManager->get($validatorObjectName);
-                       if (method_exists($validator, 'setOptions')) {
-                               // @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
-                               $validator->setOptions($validatorOptions);
-                       }
+                       $validator = $this->objectManager->get($validatorObjectName, $validatorOptions);
 
                        if (!($validator instanceof \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface)) {
                                throw new Exception\NoSuchValidatorException('The validator "' . $validatorObjectName . '" does not implement TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface!', 1300694875);