From 73f8658c36f4d8e22b60f53f3b859a3c5234a659 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 5 Feb 2003 12:41:59 +0000 Subject: [PATCH] Provide the possibility that the format of a text is not defined properly --- lib/weblib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 536d1673f1..0edaf2324f 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -473,7 +473,12 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL) { /// $format is one of the format constants, defined above switch ($format) { - case FORMAT_MOODLE: + case FORMAT_HTML: + $text = replace_smilies($text); + return $text; + break; + + default: // FORMAT_MOODLE or anything else if (!isset($options->smiley)) { $options->smiley=true; } @@ -482,11 +487,6 @@ function format_text($text, $format=FORMAT_MOODLE, $options=NULL) { } return text_to_html($text, $options->smiley, $options->para); break; - - case FORMAT_HTML: - $text = replace_smilies($text); - return $text; - break; } } -- 2.39.5