Problems with WordPress 2.1 and IIS and TinyMCE

Posted on February 5th, 2007 by Reiner.
Categories: English, at other Locations, Computers.

After upgrading to WordPress 2.1 strange things cropped up: Editing posts was unacceptably slow (after 2 minutes browser still showing xx left), icons were missing from the visual editor, and other weirdnesses made it virtually impossible to create or revise posts.

It took some time to identify the cause: With WP 2.1 running under Microsoft Internet Information Server (IIS) ISAPI, TinyMCE tries to access the webserver using https seemingly at random :-( This is caused by tiny_mce_config.php trying to determine whether the original request used https in a way that does not work with IIS and ISAPI.

The documentation at PHP cautions that the variable HTTPS will be off instead of empty when using ISAPI with IIS:
 'HTTPS'
Set to a non-empty value if the script was queried through the HTTPS protocol.
Note that when using ISAPI with IIS, the value will be off if the request was not made through the HTTPS protocol.

…/wp-includes/js/tinymce/tiny_mce_config.php uses a test condion that will not work on all platforms:
if ( $_SERVER['HTTPS']) ) {
replacing it with a more portable expression
if ( isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) { 
did the trick :-) BTW: WordPress itself uses the portable construct throughout the rest of its code.

0 comments.

Leave a comment

Comments can contain some xhtml. Names and emails are required (emails aren't displayed), url's are optional.