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 @@ ...@@ -87,8 +87,7 @@
<?= Avatar::getAvatar($accept['user_id'], $accept['username'])->getImageTag( <?= Avatar::getAvatar($accept['user_id'], $accept['username'])->getImageTag(
Avatar::SMALL, Avatar::SMALL,
[ [
'style' => 'margin-right: 5px', 'style' => 'margin-right: 5px'
'title' => $fullname,
] ]
) ?> ) ?>
<?= htmlReady($fullname) ?> <?= htmlReady($fullname) ?>
......
...@@ -98,8 +98,7 @@ ...@@ -98,8 +98,7 @@
<?= Avatar::getAvatar($autor['user_id'], $autor['username'])->getImageTag( <?= Avatar::getAvatar($autor['user_id'], $autor['username'])->getImageTag(
Avatar::SMALL, Avatar::SMALL,
[ [
'style' => 'margin-right: 5px', 'style' => 'margin-right: 5px'
'title' => $fullname
] ]
) ?> ) ?>
<?= htmlReady($fullname) ?> <?= htmlReady($fullname) ?>
......
...@@ -53,8 +53,7 @@ ...@@ -53,8 +53,7 @@
<td> <td>
<a href="<?= $controller->url_for(sprintf('profile?username=%s',$dozent['username'])) ?>" <? if ($dozent['mkdate'] >= $last_visitdate) echo 'class="new-member"'; ?>> <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, [ <?= Avatar::getAvatar($dozent['user_id'], $dozent['username'])->getImageTag(Avatar::SMALL, [
'style' => 'margin-right: 5px', 'style' => 'margin-right: 5px'
'title' => $fullname,
]) ?> ]) ?>
<?= htmlReady($fullname) ?> <?= htmlReady($fullname) ?>
</a> </a>
......
...@@ -91,8 +91,7 @@ ...@@ -91,8 +91,7 @@
<td> <td>
<a href="<?= $controller->url_for('profile?username=' . $tutor['username']) ?>" <? if ($tutor['mkdate'] >= $last_visitdate) echo 'class="new-member"'; ?>> <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, [ <?= Avatar::getAvatar($tutor['user_id'], $tutor['username'])->getImageTag(Avatar::SMALL, [
'style' => 'margin-right: 5px', 'style' => 'margin-right: 5px'
'title' => $fullname,
]) ?> ]) ?>
<?= htmlReady($fullname) ?> <?= htmlReady($fullname) ?>
</a> </a>
......
...@@ -91,8 +91,7 @@ ...@@ -91,8 +91,7 @@
<td> <td>
<a href="<?= $controller->url_for('profile?username=' . $leser['username']) ?>" <? if ($leser['mkdate'] >= $last_visitdate) echo 'class="new-member"'; ?>> <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, [ <?= Avatar::getAvatar($leser['user_id'],$leser['username'])->getImageTag(Avatar::SMALL, [
'style' => 'margin-right: 5px', 'style' => 'margin-right: 5px'
'title' => $fullname,
]); ?> ]); ?>
<?= htmlReady($fullname) ?> <?= htmlReady($fullname) ?>
</a> </a>
......
...@@ -244,9 +244,7 @@ class Avatar { ...@@ -244,9 +244,7 @@ class Avatar {
$opt['class'] = $this->getCssClass($size); $opt['class'] = $this->getCssClass($size);
} }
if (!isset($opt['title'])) { if (is_string($opt['title']) && $opt['title'] !== html_entity_decode($opt['title'])) {
$opt['title'] = $this->getDefaultTitle();
} elseif (is_string($opt['title']) && $opt['title'] !== html_entity_decode($opt['title'])) {
// Decode already htmlready encoded titles (which were used until // Decode already htmlready encoded titles (which were used until
// all attributes were encoded inside this method) // all attributes were encoded inside this method)
$opt['title'] = html_entity_decode($opt['title']); $opt['title'] = html_entity_decode($opt['title']);
...@@ -263,8 +261,10 @@ class Avatar { ...@@ -263,8 +261,10 @@ class Avatar {
} }
} }
if (!isset($opt['alt'])) { if (!isset($opt['alt']) && !isset($opt['title'])) {
$opt['alt'] = $opt['title']; //Add an empty alt attribute to prevent screen readers from
//reading the URL of the icon:
$opt['alt'] = '';
} }
return '<img ' . arrayToHtmlAttributes($opt) . '>'; 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