From: moodler Date: Wed, 21 Jul 2004 12:16:36 +0000 (+0000) Subject: Fixes for encoding, Moodle should now be able to OVERRIDE the default charset X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=03fe48e753f0fd933d6497d8a26a0395ba9a684c;p=moodle.git Fixes for encoding, Moodle should now be able to OVERRIDE the default charset that is set by Apache Fixes for no-caching case, just a little more robust. Based on patch sent by Ilia Chipitsine - thanks! --- diff --git a/lib/weblib.php b/lib/weblib.php index 13cc17062a..c766fdeb10 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -993,6 +993,9 @@ function print_header ($title="", $heading="", $navigation="", $focus="", $meta= } } $meta = "\n$meta\n"; + if (!$usexml) { + @header('Content-type: text/html; charset='.$encoding); + } if ( get_string("thisdirection") == "rtl" ) { $direction = " dir=\"rtl\""; @@ -1001,8 +1004,12 @@ function print_header ($title="", $heading="", $navigation="", $focus="", $meta= } if (!$cache) { // Do everything we can to prevent clients and proxies caching - @header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - @header("Pragma: no-cache"); + @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT'); + @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + @header('Cache-Control: no-store, no-cache, must-revalidate'); + @header('Cache-Control: post-check=0, pre-check=0', false); + @header('Pragma: no-cache'); + $meta .= "\n"; $meta .= "\n"; }