[BUGFIX] add check for empty form values in FORM View 61/11361/5
authorAlexander Stehlik <alexander.stehlik@googlemail.com>
Fri, 1 Feb 2013 12:32:15 +0000 (13:32 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 1 Feb 2013 15:03:28 +0000 (16:03 +0100)
If a FORM is submitted without any value a Fatal Error is thrown in
typo3/sysext/form/Classes/View/Confirmation/Confirmation.php on line
101. The patch adds a check for that case.

Fixes: #28606
Releases: 6.1, 6.0, 4.7, 4.6

Change-Id: I77cd57f0d56e9bdcf9517683ea21c3dc9ec1bc45
Reviewed-on: https://review.typo3.org/11361
Reviewed-by: Alexander Stehlik
Tested-by: Alexander Stehlik
Reviewed-by: Stefan Neufeind
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/form/Classes/View/Confirmation/ConfirmationView.php

index d902435..e688aec 100644 (file)
@@ -91,9 +91,13 @@ class ConfirmationView extends \TYPO3\CMS\Form\View\Confirmation\Element\Contain
        public function get() {
                $message = $this->getMessage();
                $node = $this->render('element', FALSE);
-               $formInput = chr(10) . html_entity_decode($node->saveXML($node->firstChild), ENT_QUOTES, 'UTF-8') . chr(10);
+               if ($node !== NULL) {
+                       $formInput = LF . html_entity_decode($node->saveXML($node->firstChild), ENT_QUOTES, 'UTF-8') . LF;
+               } else {
+                       $formInput = '';
+               }
                $confirmationButtons = $this->getConfirmationButtons();
-               $content = $message . chr(10) . $formInput . chr(10) . $confirmationButtons;
+               $content = $message . LF . $formInput . LF . $confirmationButtons;
                return $content;
        }