MDL-20636 Bug 11408 JME and applet components don't work in IE.

This commit is contained in:
Tim Hunt
2011-01-27 18:03:35 +00:00
parent 26a03a6112
commit 46cf70cc8c
+10
View File
@@ -568,6 +568,16 @@ function qtype_opaque_extract_stuff_from_response($opaquestate, $response, $reso
}
// Process the resources.
// TODO remove this. Evil hack. IE cannot cope with : and other odd characters
// in the name argument to window.open. Until we can deploy a fix to the
// OpenMark servers, apply the fix to the JS code here.
foreach ($response->resources as $key => $resource) {
if ($resource->filename == 'script.js') {
$response->resources[$key]->content = preg_replace(
'/(?<=window\.open\(\"\", idprefix|window\.open\(\"\",idprefix)\+(?=\"\w+\"\+id,)/',
'.replace(/\W/g,"_")+', $resource->content);
}
}
$resourcecache->cache_resources($response->resources);
// Process the other bits.