1
0
mirror of https://github.com/moodle/moodle.git synced 2025-05-05 15:57:04 +02:00

MDL-36524 do not set meta tag for IE compatibility, header should be enough

This commit is contained in:
Petr Škoda 2012-11-14 19:42:24 +01:00
parent 253251a804
commit 9172fd82b7
2 changed files with 20 additions and 7 deletions

@ -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 .= '<meta http-equiv="X-UA-Compatible" content="IE=edge" />' . "\n";
}
}
$output .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . "\n";
$output .= '<meta name="keywords" content="moodle, ' . $this->page->title . '" />' . "\n";
if (!$this->page->cacheable) {

@ -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:
* <code>
* if (!isset($CFG->additionalhtmlhead)) {
* $CFG->additionalhtmlhead = '';
* }
* $CFG->additionalhtmlhead .= '<meta http-equiv="X-UA-Compatible" content="IE=8" />';
* header('X-UA-Compatible: IE=8');
* echo $OUTPUT->header();
* </code>
*
* 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;