[TASK] Initialize FormProtectionFactory later in alt_doc.php 33/27533/3
authorWouter Wolters <typo3@wouterwolters.nl>
Mon, 10 Feb 2014 22:25:44 +0000 (23:25 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 11 Feb 2014 21:52:29 +0000 (22:52 +0100)
The FormProtectionFactory can be initialized later.
Move the initialization to the point where it is needed.

Resolves: #55856
Releases: 6.2
Change-Id: Id83304341ddec4cc2d4d5c8a6bd40463277a37b5
Reviewed-on: https://review.typo3.org/27533
Reviewed-by: Benjamin Mack
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/alt_doc.php

index 36626d0..5796d14 100644 (file)
@@ -40,10 +40,10 @@ $editDocumentController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('
 
 // Preprocessing, storing data if submitted to
 $editDocumentController->preInit();
-$formprotection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
 
 // Checks, if a save button has been clicked (or the doSave variable is sent)
 if ($editDocumentController->doProcessData()) {
+       $formprotection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
        if ($formprotection->validateToken(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('formToken'), 'editRecord')) {
                $editDocumentController->processData();
        }