Cleanup image generator
authorstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 7 Feb 2013 05:30:51 +0000 (05:30 +0000)
committerstan <stan@735d13b6-9817-0410-8766-e36946ffe9aa>
Thu, 7 Feb 2013 05:30:51 +0000 (05:30 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/sr_freecap/trunk@70945 735d13b6-9817-0410-8766-e36946ffe9aa

ChangeLog
Classes/View/ImageGenerator/ShowPng.php

index 2feb733..83d6963 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
        * Require extension vhs 1.5.0
        * Remove requirement for vhs extension
        * Fix validation error translation
+       * Cleanup image generator
 
 2012-12-15  Stanislas Rolland  <typo3@sjbr.ca>
 
index 4d29488..08cdb92 100644 (file)
@@ -166,10 +166,13 @@ class ShowPng implements \TYPO3\CMS\Extbase\MVC\View\ViewInterface {
                        // in short, there's little point trying to avoid brute forcing
                        // the best way to protect against BF attacks is to ensure the dictionary is not
                        // accessible via the web or use random string option
-                       if ($this->word->getAttempts() > $this->settings['maxAttempts']) {      
+                       if ($this->word->getAttempts() > $this->settings['maxAttempts']) {
                                $this->word->setWordHash('');
                                $this->word->setWordCypher(array());
                                $this->word->setHashFunction('');
+                               // Get an instance of the word repository
+                               $wordRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('SJBR\\SrFreecap\\Domain\\Repository\\WordRepository');
+                               // Reset the word
                                $wordRepository->setWord($this->word);
                                $string = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('max_attempts', $extensionName);
                                $font = 5;