[BUGFIX] Preview links are shown for deleted pages
[Packages/TYPO3.CMS.git] / typo3 / tce_file.php
index 807dd60..1784d79 100644 (file)
@@ -13,7 +13,7 @@
  *
  *  The GNU General Public License can be found at
  *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  A copy is found in the text file GPL.txt and important notices to the license
  *  from the author is found in LICENSE.txt distributed with these scripts.
  *
  *
 require __DIR__ . '/init.php';
 
 $fileController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\File\\FileController');
-$fileController->main();
-$fileController->finish();
+
+$formprotection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
+if ($formprotection->validateToken(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('formToken'), 'tceAction')) {
+       $fileController->main();
+}
+
+$fileController->finish();
\ No newline at end of file