Skip to content
Browse files

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
  • Loading branch information...
1 parent 9ee2ba4 commit b304495ee4e1da054329bcf8ae81a4a372b760ca @skodak skodak committed with Sam Hemelryk Oct 23, 2011
Showing with 5 additions and 10 deletions.
  1. +5 −10 lib/resourcelib.php
View
15 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 = '<param name="src" value="'.$fullurl.'" />';
- // 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) {

0 comments on commit b304495

Please sign in to comment.
Something went wrong with that request. Please try again.