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;