Fall back to wp-tinymce.js if wp-tinymce.js.gz doesn't exist

git-svn-id: http://svn.automattic.com/wordpress/trunk@11589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-06-17 01:06:32 +00:00
parent 9d293d9f0e
commit 8502dc0487
3 changed files with 5 additions and 6 deletions

View File

@ -92,8 +92,7 @@ function &get_manifest() {
if ( @is_file('../wp-includes/js/tinymce/tiny_mce.js') ) :
$mce = array(
array('../wp-includes/js/tinymce/wp-tinymce.php', 'c=1&' . $mce_ver, true),
array('../wp-includes/js/tinymce/wp-tinymce.php', 'c=0&' . $mce_ver, true),
array('../wp-includes/js/tinymce/wp-tinymce.php', $mce_ver, true),
array('../wp-includes/js/tinymce/tiny_mce.js', $mce_ver, true),
array('../wp-includes/js/tinymce/langs/wp-langs-en.js', $mce_ver, true),

View File

@ -8,7 +8,7 @@ function get_file($path) {
$path = realpath($path);
if ( ! $path || ! @is_file($path) )
return '';
return false;
return @file_get_contents($path);
}
@ -20,9 +20,9 @@ header('Vary: Accept-Encoding'); // Handle proxies
header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
header("Cache-Control: public, max-age=$expires_offset");
if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) {
if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) {
header('Content-Encoding: gzip');
echo get_file($basepath . '/wp-tinymce.js.gz');
echo $file;
} else {
echo get_file($basepath . '/wp-tinymce.js');
}

View File

@ -29,4 +29,4 @@ $tinymce_version = '3241-1141';
*
* @global string $manifest_version
*/
$manifest_version = '20090610';
$manifest_version = '20090616';