Resolves #64847: Fatal error on CaptchaValidator::isValid() from context PiBaseApi
authorstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Wed, 4 Feb 2015 17:15:49 +0000 (17:15 +0000)
committerstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Wed, 4 Feb 2015 17:15:49 +0000 (17:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/sr_freecap/trunk@88320 735d13b6-9817-0410-8766-e36946ffe9aa

ChangeLog
Classes/PiBaseApi.php
Classes/Validation/Validator/CaptchaValidator.php
Classes/Validation/Validator/TtfFileValidator.php

index 0f5be8c..4670745 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-02-04  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Resolves #64847: Fatal error on CaptchaValidator::isValid() from context PiBaseApi
+
 2015-01-28  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Cleanup
index 08dc86f..9c0c8cd 100644 (file)
@@ -119,7 +119,7 @@ class PiBaseApi {
                // Get the validator
                $validator = $this->objectManager->get('SJBR\\SrFreecap\\Validation\\Validator\\CaptchaValidator');
                // Check word
-               return $validator->isValid($word);
+               return !$validator->validate($word)->hasErrors();
        }
 }
 class_alias('SJBR\\SrFreecap\\PiBaseApi', 'tx_srfreecap_pi2');
index ef5715a..332d094 100644 (file)
@@ -44,7 +44,6 @@ class CaptchaValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractV
         */
        protected function isValid ($word) {
                $isValid = FALSE;
-               $this->errors = array();
                // Get session data
                $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
                $wordRepository = $objectManager->get('SJBR\\SrFreecap\\Domain\\Repository\\WordRepository');
index e12944a..046611a 100644 (file)
@@ -42,7 +42,6 @@ class TtfFileValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractV
         */
        protected function isValid ($value) {
                $isValid = TRUE;
-               $this->errors = array();
 
                $absoluteFileName = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($value);