-
Bug
-
Resolution: Fixed
-
Major
-
2.0, 2.1
-
MOODLE_20_STABLE, MOODLE_21_STABLE
-
MOODLE_20_STABLE, MOODLE_21_STABLE
-
w42_
MDL-29444_m22_iframe -
-
When using a URL resource with the Display type set to 'embed' to show a URL from elsewhere within Moodle, the embedded pages frequently fail to display. In IE 9 the page usually displays after a long delay (typically a minute), in IE 8 a blank frame is always displayed.
This is being caused by the following code in 'function resourcelib_embed_general' of lib/resourcelib.php
$iframe = false;
|
// 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
|
if ($mimetype === 'text/html' and check_browser_version('MSIE', 5)) {
|
if (preg_match('(^https?://[^/]*)', $fullurl, $matches)) {
|
if (strpos($CFG->wwwroot, $matches[0]) !== 0) {
|
$iframe = true;
|
}
|
}
|
}
|
This code causes URLs which match the $CFG->wwwroot to be treated differently to other URL's on the grounds that only the URL's on another server actually cause a problem. However, my tests have shown the embedding fails for local pages as well on IE.
Replication steps:
- Create a URL resource pointing at the front page of the Moodle installation with the display type set to embed.
- The page should be quickly displayed in a box on the page. In IE, the page is either slow to load (IE9) or fails to load (IE8).