Skip to content

Commit

Permalink
[BUGFIX] Remove invalid alt attribute from span elements
Browse files Browse the repository at this point in the history
Attribute alt is not allowed on span elements.

See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span#Attributes

Resolves: #92632
Releases: master, 10.4
Change-Id: If4e5762cf95535130b373d4e297a28b547686702
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/66223
Tested-by: Josef Glatz <josefglatz@gmail.com>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Haupt <mail@danielhaupt.de>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Josef Glatz <josefglatz@gmail.com>
Reviewed-by: Daniel Haupt <mail@danielhaupt.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
  • Loading branch information
georgringer authored and ervaude committed Oct 21, 2020
1 parent 7001964 commit 5b4a097
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -128,7 +128,7 @@ public function render(): array

$html = [];
$html[] = '<a ' . GeneralUtility::implodeAttributes($linkAttributes, true) . '>';
$html[] = '<span alt="' . htmlspecialchars($title) . '" title="' . htmlspecialchars($title) . '">';
$html[] = '<span title="' . htmlspecialchars($title) . '">';
$html[] = $iconFactory->getIcon($icon, Icon::SIZE_SMALL)->render();
$html[] = '</span>';
$html[] = '</a>';
Expand Down
Expand Up @@ -1128,15 +1128,15 @@ public function ext_printFields($theConstants, $category)
$deleteIcon = $iconFactory->getIcon('actions-edit-undo', Icon::SIZE_SMALL)->render();
$deleteIconHTML =
'<button type="button" class="btn btn-default t3js-toggle" data-toggle="undo" rel="' . $idName . '">'
. '<span title="' . $deleteTitle . '" alt="' . $deleteTitle . '">'
. '<span title="' . $deleteTitle . '">'
. $deleteIcon
. '</span>'
. '</button>';
$editTitle = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.editTitle'));
$editIcon = $iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render();
$editIconHTML =
'<button type="button" class="btn btn-default t3js-toggle" data-toggle="edit" rel="' . $idName . '">'
. '<span title="' . $editTitle . '" alt="' . $editTitle . '">'
. '<span title="' . $editTitle . '">'
. $editIcon
. '</span>'
. '</button>';
Expand Down

0 comments on commit 5b4a097

Please sign in to comment.