diff --git a/lib/weblib.php b/lib/weblib.php index ec287ffdf6b..1b5dcb4b70b 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2032,8 +2032,13 @@ function cleanAttributes2($htmlArray){ * @return string */ function replace_smilies(&$text) { -/// + global $CFG; + + if (empty($CFG->emoticons)) { /// No emoticons defined, nothing to process here + return; + } + $lang = current_language(); $emoticonstring = $CFG->emoticons; static $e = array();