diff --git a/lib/moodlelib.php b/lib/moodlelib.php index b5b1123af5a..5c4c067cdd4 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -5905,7 +5905,12 @@ class amos_string_manager implements string_manager { $string = $this->load_component_strings($component, $lang); if (!isset($string[$identifier])) { - if ($identifier !== 'parentlanguage' and $component !== 'pix') { + if ($component === 'pix' or $component === 'core_pix') { + // this component contains only alt tags for emoticons, + // not all of them are supposed to be defined + return ''; + } + if ($identifier !== 'parentlanguage') { debugging("Invalid get_string() identifier: '$identifier' or component '$component'", DEBUG_DEVELOPER); } return "[[$identifier]]"; diff --git a/lib/weblib.php b/lib/weblib.php index 9fd5be5a489..75fd98f6c94 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1628,7 +1628,9 @@ function replace_smilies(&$text) { $img[$lang] = array(); foreach ($emoticons as $emoticon => $image){ $alttext = get_string($image, 'pix'); - $alttext = preg_replace('/^\[\[(.*)\]\]$/', '$1', $alttext); /// Clean alttext in case there isn't lang string for it. + if ($alttext === '') { + $alttext = $image; + } $e[$lang][] = $emoticon; $img[$lang][] = ''. $alttext .''; }