diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 76b0c834387f0..5b51cdf52c4ab 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -510,9 +510,8 @@ public function __construct($pix, $alt, $component='moodle', array $attributes = if (empty($this->attributes['class'])) { $this->attributes['class'] = 'smallicon'; } - if (!isset($this->attributes['title'])) { - $this->attributes['title'] = $this->attributes['alt']; - } else if (empty($this->attributes['title'])) { + + if (empty($this->attributes['title'])) { // Remove the title attribute if empty, we probably want to use the parent node's title // and some browsers might overwrite it with an empty title. unset($this->attributes['title']);