[BUGFIX] Avoid empty "name" attribute on f:form.submit 35/44135/5
authorClaus Due <claus@namelesscoder.net>
Sat, 17 Oct 2015 23:49:13 +0000 (01:49 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 22 Oct 2015 08:44:07 +0000 (10:44 +0200)
Empty name attribute causes invalid HTML. Avoiding the
attribute if resolved name of submit button is empty
avoids this invalid HTML.

Change-Id: Ib9fb6bf24d64deb2e6d9c381ae407392a86d5ad7
Fixes: #70488
Fixes: #70486
Releases: master
Reviewed-on: https://review.typo3.org/44135
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/fluid/Classes/ViewHelpers/Form/SubmitViewHelper.php

index c943d0b..7157fde 100644 (file)
@@ -67,8 +67,10 @@ class SubmitViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFie
         $this->registerFieldNameForFormTokenGeneration($name);
 
         $this->tag->addAttribute('type', 'submit');
-        $this->tag->addAttribute('name', $name);
         $this->tag->addAttribute('value', $this->getValueAttribute());
+        if (!empty($name)) {
+            $this->tag->addAttribute('name', $name);
+        }
 
         return $this->tag->render();
     }