From: skodak Date: Tue, 20 Mar 2007 20:47:57 +0000 (+0000) Subject: MDL-8976 smilies alt text was cached in one static cache for all langs; merged from... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5a144b3ac91eb581b79d3badd0c7c1361b2fd07d;p=moodle.git MDL-8976 smilies alt text was cached in one static cache for all langs; merged from MOODLE_18_STABLE --- diff --git a/lib/weblib.php b/lib/weblib.php index 4ad2020243..39a1d35a71 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1774,8 +1774,9 @@ function replace_smilies(&$text) { /// global $CFG; + $lang = current_language(); + /// this builds the mapping array only once - static $runonce = false; static $e = array(); static $img = array(); static $emoticons = array( @@ -1809,14 +1810,15 @@ function replace_smilies(&$text) { '( )' => 'egg' ); - if ($runonce == false) { /// After the first time this is not run again + if (empty($img[$lang])) { /// After the first time this is not run again + $e[$lang] = array(); + $img[$lang] = array(); foreach ($emoticons as $emoticon => $image){ $alttext = get_string($image, 'pix'); - $e[] = $emoticon; - $img[] = ''. $alttext .''; + $e[$lang][] = $emoticon; + $img[$lang][] = ''. $alttext .''; } - $runonce = true; } // Exclude from transformations all the code inside