Skip to content
Snippets Groups Projects
Commit c7ccce8f authored by Moritz Strohm's avatar Moritz Strohm
Browse files

fix for BIESt #553

parent f0e8ebaa
No related branches found
No related tags found
No related merge requests found
......@@ -87,8 +87,7 @@
<?= Avatar::getAvatar($accept['user_id'], $accept['username'])->getImageTag(
Avatar::SMALL,
[
'style' => 'margin-right: 5px',
'title' => $fullname,
'style' => 'margin-right: 5px'
]
) ?>
<?= htmlReady($fullname) ?>
......
......@@ -98,8 +98,7 @@
<?= Avatar::getAvatar($autor['user_id'], $autor['username'])->getImageTag(
Avatar::SMALL,
[
'style' => 'margin-right: 5px',
'title' => $fullname
'style' => 'margin-right: 5px'
]
) ?>
<?= htmlReady($fullname) ?>
......
......@@ -53,8 +53,7 @@
<td>
<a href="<?= $controller->url_for(sprintf('profile?username=%s',$dozent['username'])) ?>" <? if ($dozent['mkdate'] >= $last_visitdate) echo 'class="new-member"'; ?>>
<?= Avatar::getAvatar($dozent['user_id'], $dozent['username'])->getImageTag(Avatar::SMALL, [
'style' => 'margin-right: 5px',
'title' => $fullname,
'style' => 'margin-right: 5px'
]) ?>
<?= htmlReady($fullname) ?>
</a>
......
......@@ -91,8 +91,7 @@
<td>
<a href="<?= $controller->url_for('profile?username=' . $tutor['username']) ?>" <? if ($tutor['mkdate'] >= $last_visitdate) echo 'class="new-member"'; ?>>
<?= Avatar::getAvatar($tutor['user_id'], $tutor['username'])->getImageTag(Avatar::SMALL, [
'style' => 'margin-right: 5px',
'title' => $fullname,
'style' => 'margin-right: 5px'
]) ?>
<?= htmlReady($fullname) ?>
</a>
......
......@@ -91,8 +91,7 @@
<td>
<a href="<?= $controller->url_for('profile?username=' . $leser['username']) ?>" <? if ($leser['mkdate'] >= $last_visitdate) echo 'class="new-member"'; ?>>
<?= Avatar::getAvatar($leser['user_id'],$leser['username'])->getImageTag(Avatar::SMALL, [
'style' => 'margin-right: 5px',
'title' => $fullname,
'style' => 'margin-right: 5px'
]); ?>
<?= htmlReady($fullname) ?>
</a>
......
......@@ -244,9 +244,7 @@ class Avatar {
$opt['class'] = $this->getCssClass($size);
}
if (!isset($opt['title'])) {
$opt['title'] = $this->getDefaultTitle();
} elseif (is_string($opt['title']) && $opt['title'] !== html_entity_decode($opt['title'])) {
if (is_string($opt['title']) && $opt['title'] !== html_entity_decode($opt['title'])) {
// Decode already htmlready encoded titles (which were used until
// all attributes were encoded inside this method)
$opt['title'] = html_entity_decode($opt['title']);
......@@ -263,8 +261,10 @@ class Avatar {
}
}
if (!isset($opt['alt'])) {
$opt['alt'] = $opt['title'];
if (!isset($opt['alt']) && !isset($opt['title'])) {
//Add an empty alt attribute to prevent screen readers from
//reading the URL of the icon:
$opt['alt'] = '';
}
return '<img ' . arrayToHtmlAttributes($opt) . '>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment