A Free Template From Joomlashack

A Free Template From Joomlashack

Banner

SSL / HTTPS bug in Wordpress 2.5 Tinymce

PDF Print E-mail
Written by Kirby   
Monday, 21 April 2008 15:39

So I upgraded to Wordpress 2.5 and everything seemed great until a user reported that every popup dialog in the admin back end was showing up blank.


Firefox showed this error:
"uncaught exception: permission to denied get property Window.tinymce"

Safari showed this:
"Unsafe JavaScript attempt to access frame with URL https://<install url+dir>/wp-admin/post.php?action=edit&post=794 from frame with URL http://<install url+dir>/wp-includes/js/tinymce/plugins/media/media.htm. Domains, protocols and ports must match."

The forums weren't much help with such tips as "Make sure you're not using an old install." Maybe this was good for some people. I'm thinking that most people running Wordpress aren't running the backend over https. However, I'd hope that at least some of the developers working on Wordpress use SSL for their logins.

 After some cursing and grinding of teeth I realized that if I did a 'View only this frame' in Firefox, the window showed an address of http, not https. Well, that explained it. You can trace what windows are accessed by Wordpress for the Image window, the color picker, special characters to this file, editor_template.js.

Near the very end of the file, you'll se a bunch of references to .htm files:
ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm'...

This is where the problem shows up. I'm sure it doesn't begin in this file but I don't have the time to trace it all the way back. I'm hoping someone will notice the trac ticket I entered, posts in the forum or other users complaining about the same thing.

Anyway, if you are running your wp-admin pages over ssl and are getting blank dialog boxes in Tinymce, try right clicking and doing the 'View only this frame' trick. If you see http: and not https: in your browser bar, you aren't going to get those popups back without this hack, some other hack or a fix from Wordpress developers.

First, back up your editor_template.js. You might as well keep the original around in case your hacking screws up Tinymce any more than it is. Edit any references to a .htm file in editor_template like this:
ed.windowManager.open({url:tinymce.baseURL+'/themes/advanced/anchor.htm'...
becomes:
ed.windowManager.open({url:'https://<your domain and wordpress path here>/wp-includes/js/tinymce/themes/advanced/anchor.htm'...

If you don't know what to replace <your domain and wordpress path here> with, you probably shouldn't be hacking wordpress.

Oh, also there's a javascript cache that lives at wp-content/uploads/js_cache. You will need to delete the file in there for your fix to show up. The filename will be something like:
tinymce_<long random alphanumeric string>.gz

Usual list of caveats: YMMV, I am not a Wordpress developer, Please backup your files before hacking, Always wear gloves and safety goggles, etc.

Good luck,
K

P.S. For the embedded media popup, you'll need to hack:
./wp-includes/js/tinymce/plugins/media/editor_plugin.js

look for:
ed.windowManager.open({file:url+'/media.htm
and make it:
https://<your domain and wordpress path here>/wp-includes/js/tinymce/plugins/media/media.htm

Last Updated ( Saturday, 22 November 2008 15:14 )
 
Joomla 1.5 Templates by Joomlashack