diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 45b2dccd752..2866dbe64fa 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -2117,14 +2117,19 @@ class core_renderer extends renderer_base { $attributes['class'] = 'action-icon'; } - $icon = $this->render($pixicon); - if ($linktext) { $text = $pixicon->attributes['alt']; + // Set the icon as a decorative image if we're displaying the action text. + // Otherwise, the action name will be read twice by assistive technologies. + $pixicon->attributes['alt'] = ''; + $pixicon->attributes['title'] = ''; + $pixicon->attributes['aria-hidden'] = 'true'; } else { $text = ''; } + $icon = $this->render($pixicon); + return $this->action_link($url, $text.$icon, $action, $attributes); }