[BUGFIX] Remove singleton for EXT:form Localization
[Packages/TYPO3.CMS.git] / typo3 / sysext / form / Classes / Controller / FormController.php
index c02d5f7..d4acd61 100644 (file)
@@ -68,7 +68,6 @@ class FormController {
         * @return void
         */
        public function initialize(array $typoscript) {
-               \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Localization', 'LLL:EXT:form/Resources/Private/Language/locallang_controller.xml');
                $this->typoscriptFactory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Domain\\Factory\\TypoScriptFactory');
                $this->localizationHandler = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Localization');
                $this->requestHandler = $this->typoscriptFactory->setRequestHandler($typoscript);
@@ -98,8 +97,8 @@ class FormController {
                if ($typoScriptObjectName === 'FORM') {
                        if ($contentObject->data['CType'] === 'mailform') {
                                $bodytext = $contentObject->data['bodytext'];
-                               /** @var $typoScriptParser t3lib_tsparser */
-                               $typoScriptParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_tsparser');
+                               /** @var $typoScriptParser \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser */
+                               $typoScriptParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
                                $typoScriptParser->parse($bodytext);
                                $mergedTypoScript = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule((array) $typoScriptParser->setup, (array) $typoScript);
                                // Disables content elements since TypoScript is handled that could contain insecure settings:
@@ -150,7 +149,7 @@ class FormController {
        protected function showForm() {
                $show = FALSE;
                $submittedByPrefix = $this->requestHandler->getByMethod();
-               if (($submittedByPrefix === NULL || !empty($submittedByPrefix) && !$this->validate->isValid()) || (!empty($submittedByPrefix) && $this->validate->isValid()) && $this->requestHandler->getPost('confirmation-false', NULL) !== NULL) {
+               if ($submittedByPrefix === NULL || !empty($submittedByPrefix) && !$this->validate->isValid() || !empty($submittedByPrefix) && $this->validate->isValid() && $this->requestHandler->getPost('confirmation-false', NULL) !== NULL) {
                        $show = TRUE;
                }
                return $show;
@@ -181,7 +180,7 @@ class FormController {
         */
        protected function showConfirmation() {
                $show = FALSE;
-               if ((isset($this->typoscript['confirmation']) && $this->typoscript['confirmation'] == 1) && $this->requestHandler->getPost('confirmation-true', NULL) === NULL) {
+               if (isset($this->typoscript['confirmation']) && $this->typoscript['confirmation'] == 1 && $this->requestHandler->getPost('confirmation-true', NULL) === NULL) {
                        $show = TRUE;
                }
                return $show;