From 3df93d6d88c81fcdd00359f08cce4eb7c82d88c6 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 23 Oct 2011 21:14:04 +0200 Subject: [PATCH] MDL-29444 use iframe embedding in IE iframe is back in HTML 5, we can safely use it in IE for all text documents because object embedding has multiple problems --- lib/resourcelib.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/resourcelib.php b/lib/resourcelib.php index 7aeed91405961..25c8e721b8fe3 100644 --- a/lib/resourcelib.php +++ b/lib/resourcelib.php @@ -477,6 +477,7 @@ function resourcelib_embed_pdf($fullurl, $title, $clicktoopen) { * @param string $fullurl * @param string $title * @param string $clicktoopen + * @param string $mimetype * @return string html */ function resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype) { @@ -490,17 +491,11 @@ function resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype) { $param = ''; - // IE can not embed stuff properly if stored on different server - // that is why we use iframe instead, unfortunately this tag does not validate - // in xhtml strict mode + // IE can not embed stuff properly, that is why we use iframe instead. + // Unfortunately this tag does not validate in xhtml strict mode, + // but in any case it is undeprecated in HTML 5 - we will use it everywhere soon! if ($mimetype === 'text/html' and check_browser_version('MSIE', 5)) { - // The param tag needs to be removed to avoid trouble in IE. - $param = ''; - if (preg_match('(^https?://[^/]*)', $fullurl, $matches)) { - if (strpos($CFG->wwwroot, $matches[0]) !== 0) { - $iframe = true; - } - } + $iframe = true; } if ($iframe) {