From 9172fd82b7b7fe3bacb877b74cf648046ad460fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Wed, 14 Nov 2012 19:42:24 +0100 Subject: [PATCH] MDL-36524 do not set meta tag for IE compatibility, header should be enough --- lib/outputrenderers.php | 6 ------ lib/weblib.php | 21 ++++++++++++++++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index c38de619a41..45d9618c84b 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -346,12 +346,6 @@ class core_renderer extends renderer_base { public function standard_head_html() { global $CFG, $SESSION; $output = ''; - if ($this->page->theme->doctype === 'html5' or $this->page->theme->doctype === 'xhtml5') { - // Make sure we set 'X-UA-Compatible' only if script did not request something else (such as MDL-29213). - if (empty($CFG->additionalhtmlhead) or stripos($CFG->additionalhtmlhead, 'X-UA-Compatible') === false) { - $output .= '' . "\n"; - } - } $output .= '' . "\n"; $output .= '' . "\n"; if (!$this->page->cacheable) { diff --git a/lib/weblib.php b/lib/weblib.php index 8bdf838c9bc..25b7bb9eb50 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1840,7 +1840,26 @@ function get_html_lang($dir = false) { /** * Send the HTTP headers that Moodle requires. - * @param $cacheable Can this page be cached on back? + * + * There is a backwards compatibility hack for legacy code + * that needs to add custom IE compatibility directive. + * + * Example: + * + * if (!isset($CFG->additionalhtmlhead)) { + * $CFG->additionalhtmlhead = ''; + * } + * $CFG->additionalhtmlhead .= ''; + * header('X-UA-Compatible: IE=8'); + * echo $OUTPUT->header(); + * + * + * Please note the $CFG->additionalhtmlhead alone might not work, + * you should send the IE compatibility header() too. + * + * @param string $contenttype + * @param bool $cacheable Can this page be cached on back? + * @return void, sends HTTP headers */ function send_headers($contenttype, $cacheable = true) { global $CFG;