]> git.mjollnir.org Git - moodle.git/commitdiff
Emoticons MDLSITE-564 Patch to avoid [[brackets]] around alt text
authormoodler <moodler>
Mon, 24 Nov 2008 01:05:55 +0000 (01:05 +0000)
committermoodler <moodler>
Mon, 24 Nov 2008 01:05:55 +0000 (01:05 +0000)
lib/weblib.php

index b443ef7b5e10bd68aa538a007c89a00729ba2920..e87756f7777dd74550f4f3e113811b1649c530b7 100644 (file)
@@ -2031,6 +2031,7 @@ 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.
             $e[$lang][] = $emoticon;
             $img[$lang][] = '<img alt="'. $alttext .'" width="15" height="15" src="'. $CFG->pixpath .'/s/'. $image .'.gif" />';
         }