]> git.mjollnir.org Git - moodle.git/commitdiff
Provide the possibility that the format of a text is not defined properly
authormoodler <moodler>
Wed, 5 Feb 2003 12:41:59 +0000 (12:41 +0000)
committermoodler <moodler>
Wed, 5 Feb 2003 12:41:59 +0000 (12:41 +0000)
lib/weblib.php

index 536d1673f162164e2cdd0aff6abb2150d41580c1..0edaf2324feac84a42a1ba60b0006ab4282c3b4a 100644 (file)
@@ -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;
     }
 }