[BUGFIX] Menu-links generate two empty spaces at closing anchor 22/25322/4
authorTomita Militaru <militarutomita@gmail.com>
Tue, 12 Nov 2013 15:52:33 +0000 (17:52 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Fri, 18 Jul 2014 22:02:15 +0000 (00:02 +0200)
Checks for ATagParams & access key code before adding empty
spaces between anchor parameters.

Resolves: #50566
Releases: 6.3, 6.2, 6.1
Change-Id: I57a2a2a06a97fc1eda6e0438bfdc6e210437e5bb
Reviewed-on: https://review.typo3.org/25322
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php

index c462be3..7b58247 100644 (file)
@@ -1692,7 +1692,9 @@ class AbstractMenuContentObject {
         * @todo Define visibility
         */
        public function setATagParts() {
-               $this->I['A1'] = '<a ' . GeneralUtility::implodeAttributes($this->I['linkHREF'], 1) . ' ' . $this->I['val']['ATagParams'] . $this->I['accessKey']['code'] . '>';
+               $params = trim($this->I['val']['ATagParams']) . $this->I['accessKey']['code'];
+               $params = $params !== '' ? ' ' . $params : '';
+               $this->I['A1'] = '<a ' . GeneralUtility::implodeAttributes($this->I['linkHREF'], 1) . $params . '>';
                $this->I['A2'] = '</a>';
        }