[BUGFIX] Force closing tag in PageViewHelper 11/59811/3
authorRiny van Tiggelen <info@online-gamer.nl>
Wed, 27 Feb 2019 10:08:41 +0000 (11:08 +0100)
committerBenni Mack <benni@typo3.org>
Mon, 4 Mar 2019 13:54:34 +0000 (14:54 +0100)
Unlike all the other link viewhelpers (based on tagbuilder),
the PageViewHelper does not force the closing tag which
results in an invalid tag when there is no content available.

Resolves: #87804
Releases: master, 9.5, 8.7
Change-Id: Ia49aaf1f2f80be4fa3febee08f5285bebd2c0189
Reviewed-on: https://review.typo3.org/c/59811
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Guido Schmechel <guido.schmechel@brandung.de>
Tested-by: Richard Haeser <richard@maxserv.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Richard Haeser <richard@maxserv.com>
Reviewed-by: André Schließer <andy.schliesser@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Benni Mack <benni@typo3.org>
typo3/sysext/fluid/Classes/ViewHelpers/Link/PageViewHelper.php

index 449d8a5..0866df7 100644 (file)
@@ -114,6 +114,7 @@ class PageViewHelper extends AbstractTagBasedViewHelper
         if ((string)$uri !== '') {
             $this->tag->addAttribute('href', $uri);
             $this->tag->setContent($this->renderChildren());
+            $this->tag->forceClosingTag(true);
             $result = $this->tag->render();
         } else {
             $result = $this->renderChildren();