]> git.mjollnir.org Git - moodle.git/commitdiff
A default format for format_text() and a workaround embedded
authormoodler <moodler>
Sun, 17 Nov 2002 10:45:34 +0000 (10:45 +0000)
committermoodler <moodler>
Sun, 17 Nov 2002 10:45:34 +0000 (10:45 +0000)
for sites with the buggy referer problem :

  define $CFG->buggy_referer = true in the config.php to activate it

lib/weblib.php

index 28604d29201c65434f1bc088b8c7091cafd5affe..19dcab0ba32bb2100b8bd1b6438247093b8eb0fc 100644 (file)
@@ -146,6 +146,11 @@ function qualified_me() {
 function match_referer($good_referer = "") {
 /// returns true if the referer is the same as the good_referer.  If
 /// good_referer is not specified, use qualified_me as the good_referer 
+    global $CFG;
+
+    if ($CFG->buggy_referer) {
+        return true;
+    }
 
        if ($good_referer == "") { 
         $good_referer = qualified_me(); 
@@ -374,7 +379,7 @@ function format_text_menu() {
                   FORMAT_HTML   => get_string("formathtml") );
 }
 
-function format_text($text, $format, $options=NULL) {
+function format_text($text, $format=FORMAT_MOODLE, $options=NULL) {
 /// Given text in a variety of format codings, this function returns 
 /// the text as safe HTML.
 ///