[fixed] SWFobject 2 + Mootools craches IE6

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
louisk
Forum Members
Forum Members
Posts: 89
Joined: Wed May 30, 2007 7:40 pm

[fixed] SWFobject 2 + Mootools craches IE6

Post by louisk »

i found a (kind of) major bug... but it isn't any ones bad.
CMSMS adds the tag at the top of the every page. But when you have flash on your page using the new SWFobject 2 in combination with the MooTools 1.2 java script framework, Internet Explorer craches completely :o
This error presumably will also occur with older versions of SWFobject and/or MooTools and other combinations of java scripts.

The fix is to add a small pies of code that closes the base tag () only in Internet Explorer.

Open the file plugins/function.metadata.php and go to line 44 where it says $result .= "\n\n";

Just add replace it with this line: $result .= "\n\n";

And the problem is fixed.

I suggest adding this change to the distributed file just in case people run into this problem (as it's pretty hard to find anything on the net about this problem)
soundZ
Forum Members
Forum Members
Posts: 14
Joined: Fri Nov 14, 2008 6:24 am

Re: [fixed] SWFobject 2 + Mootools craches IE6

Post by soundZ »

Hello louisk,

thanks a lot for that hint! Your workaround works realy fine, but I think it's not valid in the end  ;)
A clean and valid version without conditional comments would be the following:

line 44 in plugins/function.metadata.php:

Code: Select all

$result .= "\n<base href=\"".$config['root_url']."/\"></base>\n";
It's a little bit unusal notation in XHTML for empty Tags, but it's OK and valid. And the truly astonishing fact about this solution is: you save 27 bytes in your code!  ;D  ;D  ;D
Post Reply

Return to “Tips and Tricks”