From 60f18531c8040266edce7444e6cb9350fa9cf68a Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 17 Nov 2002 10:45:34 +0000 Subject: [PATCH] A default format for format_text() and a workaround embedded for sites with the buggy referer problem : define $CFG->buggy_referer = true in the config.php to activate it --- lib/weblib.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/weblib.php b/lib/weblib.php index 28604d2920..19dcab0ba3 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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. /// -- 2.39.5