Fix for Wordpress 2.8 and Issues with TinyMCE

We give you Interactive Know-How

As you might have read earlier, we here at Fourth Floor Interactive tend to use Wordpress quite extensively in our interactive projects as a solution to our clients’ CMS needs. Recently with Wordpress 2.8+, we’ve noticed a bit of an issue with TinyMCE disappearing, allowing for no easy visual editing for our clients. Obviously we immediately started on a work-around and found just that.

It appears that the compression is the gzip compression is the issue. In the file /wp-includes/js/tinymce/wp-tinymce.php we found if we replaced:

if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) {
  header('Content-Encoding: gzip');
  echo get_file($basepath . '/wp-tinymce.js.gz');
} else {
  echo get_file($basepath . '/wp-tinymce.js');
}
exit;



With the following:

if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) {
  // header('Content-Encoding: gzip');
  echo get_file($basepath . '/wp-tinymce.js');
  //echo get_file($basepath . '/wp-tinymce.js.gz');
} else {
  echo get_file($basepath . '/wp-tinymce.js');
}
exit;



Essentially this will not allow the gzip encoding version of the file and will therefore remove the two options and bring back just the single option of.  In order to keep the code somewhat close to the original (in the case of further edits), we chose to keep the if/else statement and simply comment out the previous code.  This change to the code seems to solve the disappearance of the the TinyMCE editor (at least in our case).

Please note, only code monkeys or otherwise those knowledgable of PHP/HTML/JS should be editing these files.  If you are not one of the above but wish to try this, please make sure to download and backup this file before you do so.

Tags: , , , , ,

Leave a Reply