Commit 20042027 authored by Benni Mack's avatar Benni Mack
Browse files

[BUGFIX] Only render title attribute when given in image

In change https://git.typo3.org/Packages/TYPO3.CMS.git/commit/e6e40cd214acc8581729ef9f6e98c5d9324ec11c
of bugfix #90656 the title attribute of the result was changed
to always be added, which should only be added when the
title is not empty.

Resolves: #91506
Related: #90656
Releases: master, 10.4
Change-Id: Ie267f89b5ae82daeb036c820391099f06bfccbaf
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64634


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 4f913d95
......@@ -199,8 +199,9 @@ class ImageViewHelper extends AbstractTagBasedViewHelper
if (empty($this->arguments['alt'])) {
$this->tag->addAttribute('alt', $image->hasProperty('alternative') ? $image->getProperty('alternative') : '');
}
if (empty($this->arguments['title']) && $image->hasProperty('title')) {
$this->tag->addAttribute('title', $image->getProperty('title'));
$title = $image->hasProperty('title') ? $image->getProperty('title') : '';
if (empty($this->arguments['title']) && $title !== '') {
$this->tag->addAttribute('title', $title);
}
} catch (ResourceDoesNotExistException $e) {
// thrown if file does not exist
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment