From 183a13c294117d948effbfff58b1dfcc987f340f Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sun, 11 May 2008 23:34:29 +0000 Subject: [PATCH] Prevent some notices and process if $CFG->emoticons is not set or empty. MDL-12414 ; merged from 19_STABLE --- lib/weblib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index ec287ffdf6..1b5dcb4b70 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(); -- 2.39.5