diff --git a/wp-includes/js/autosave.js.php b/wp-includes/js/autosave.js.php index 6dc1bac5a7..a8648f0118 100644 --- a/wp-includes/js/autosave.js.php +++ b/wp-includes/js/autosave.js.php @@ -72,7 +72,7 @@ function autosave_saved() { function autosave() { var form = $('post'); - var rich = tinyMCE.getInstanceById('content') ? true : false; + var rich = ((typeof tinyMCE != "undefined") && tinyMCE.getInstanceById('content')) ? true : false; autosaveAjax = new sack(); diff --git a/wp-includes/js/tinymce/tiny_mce_gzip.php b/wp-includes/js/tinymce/tiny_mce_gzip.php index d92e08e031..686fb6122b 100644 --- a/wp-includes/js/tinymce/tiny_mce_gzip.php +++ b/wp-includes/js/tinymce/tiny_mce_gzip.php @@ -35,8 +35,9 @@ function wp_tinymce_lang($path) { // Fall back on en.js - if ( empty($text) ) - $text = file_get_contents(realpath(sprintf($path, 'en'))); + $file = realpath(sprintf($path, 'en')); + if ( empty($text) && file_exists($file) ) + $text = file_get_contents($file); // Send lang file through gettext if ( function_exists('__') && strtolower(substr($language, 0, 2)) != 'en' ) {