From d92d57bd140a30fbb5652df4e1e8c7346c5a5803 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 18 Feb 2008 19:25:56 +0000 Subject: [PATCH] TinyMCE compressor fixes from azaozz. fixes #5900 git-svn-id: http://svn.automattic.com/wordpress/trunk@6900 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/tinymce/tiny_mce_config.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index c7a5addb8d..26db6eba65 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -125,7 +125,7 @@ $initArray = array ( // pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init" 'disk_cache' => true, 'compress' => true, - 'old_cache_max' => '3' // number of cache files to keep + 'old_cache_max' => '1' // number of cache files to keep ); if ( $valid_elements ) $initArray['valid_elements'] = $valid_elements; @@ -252,12 +252,12 @@ echo $content; // Write file if ( '' != $cacheKey && $cache_path ) { if ( $old_cache_max ) { - $old_keys = getFileContents('tinymce_compressed_key' . $cache_ext); + $old_keys = getFileContents('tinymce_compressed' . $cache_ext . '_key'); if ( '' != $old_keys ) { $keys_ar = explode( "\n", $old_keys ); - if ( ($old_cache_max - 1) > count($old_keys_ar) ) - $old_keys_rem = array_slice( $keys_ar, ($old_cache_max - 1) ); + if ( 1 >= $old_cache_max ) $old_keys_rem = $keys_ar; + else $old_keys_rem = array_slice( $keys_ar, ($old_cache_max - 1) ); foreach ( $old_keys_rem as $key ) { $key = trim($key); @@ -272,7 +272,7 @@ if ( '' != $cacheKey && $cache_path ) { } - putFileContents( 'tinymce_compressed_key' . $cache_ext, $cacheKey ); + putFileContents( 'tinymce_compressed' . $cache_ext . '_key', $cacheKey ); } putFileContents( $cache_file, $content );