diff --git a/wp-admin/load-scripts.php b/wp-admin/load-scripts.php
index a24949b1f9..07573a6f52 100644
--- a/wp-admin/load-scripts.php
+++ b/wp-admin/load-scripts.php
@@ -85,24 +85,19 @@ function get_file($path) {
return @file_get_contents($path);
}
+// Discard any buffers
+while ( @ob_end_clean() );
+
if ( isset($_GET['test']) && 1 == $_GET['test'] ) {
if ( ini_get('zlib.output_compression') )
exit('');
-
- $out = 'var wpCompressionTest = 1;';
- $compressed = false;
- if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') ) {
- header('Content-Encoding: deflate');
- $out = gzdeflate( $out, 3 );
- $compressed = true;
- } elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) {
+ if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) {
header('Content-Encoding: gzip');
- $out = gzencode( $out, 3 );
- $compressed = true;
+ $out = gzencode( 'var wpCompressionTest = 1;', 3 );
}
- if ( ! $compressed )
+ if ( ! isset($out) )
exit('');
header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
@@ -123,9 +118,6 @@ if ( empty($load) )
require(ABSPATH . '/wp-includes/script-loader.php');
require(ABSPATH . '/wp-includes/version.php');
-// Discard any buffers
-while ( @ob_end_clean() );
-
$compress = ( isset($_GET['c']) && 1 == $_GET['c'] );
$expires_offset = 31536000;
$out = '';
@@ -142,15 +134,12 @@ foreach( $load as $handle ) {
}
header('Content-Type: application/x-javascript; charset=UTF-8');
-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 ( $compress && ! ini_get('zlib.output_compression') ) {
- if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') ) {
- header('Content-Encoding: deflate');
- $out = gzdeflate( $out, 3 );
- } elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) {
+if ( $compress && ! ini_get('zlib.output_compression') && function_exists('gzencode') ) {
+ header('Vary: Accept-Encoding'); // Handle proxies
+ if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) {
header('Content-Encoding: gzip');
$out = gzencode( $out, 3 );
}
diff --git a/wp-admin/load-styles.php b/wp-admin/load-styles.php
index f7e61ff1e4..ddbf065079 100644
--- a/wp-admin/load-styles.php
+++ b/wp-admin/load-styles.php
@@ -123,15 +123,12 @@ foreach( $load as $handle ) {
}
header('Content-Type: text/css');
-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 ( $compress && ! ini_get('zlib.output_compression') ) {
- if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') ) {
- header('Content-Encoding: deflate');
- $out = gzdeflate( $out, 3 );
- } elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) {
+if ( $compress && ! ini_get('zlib.output_compression') && function_exists('gzencode') ) {
+ header('Vary: Accept-Encoding'); // Handle proxies
+ if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) {
header('Content-Encoding: gzip');
$out = gzencode( $out, 3 );
}
diff --git a/wp-includes/js/tinymce/wp-tinymce.php b/wp-includes/js/tinymce/wp-tinymce.php
index e9a3ff1561..c07639a9e7 100644
--- a/wp-includes/js/tinymce/wp-tinymce.php
+++ b/wp-includes/js/tinymce/wp-tinymce.php
@@ -1,5 +1,7 @@
concat" . "$wp_scripts->concat_version");
- $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&load=" . rtrim($wp_scripts->concat, ',') . "&ver=$ver";
+ $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&load=" . rtrim($wp_scripts->concat, ',') . "&ver=$ver";
echo "\n";
}
@@ -606,7 +606,7 @@ function _pring_scripts() {
}
function wp_print_admin_styles() {
- global $wp_styles, $concatenate_scripts, $compress_scripts;
+ global $wp_styles, $concatenate_scripts, $compress_css;
if ( !is_a($wp_styles, 'WP_Styles') )
$wp_styles = new WP_Styles();
@@ -615,7 +615,7 @@ function wp_print_admin_styles() {
script_concat_settings();
$wp_styles->do_concat = $concatenate_scripts;
- $zip = $compress_scripts ? 1 : 0;
+ $zip = $compress_css ? 1 : 0;
$wp_styles->do_items(false);
@@ -623,7 +623,7 @@ function wp_print_admin_styles() {
if ( !empty($wp_styles->concat) ) {
$ver = md5("$wp_styles->concat" . "$wp_styles->concat_version");
$rtl = 'rtl' === $wp_styles->text_direction ? 1 : 0;
- $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&rtl={$rtl}&load=" . rtrim($wp_styles->concat, ',') . "&ver=$ver";
+ $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&rtl={$rtl}&load=" . rtrim($wp_styles->concat, ',') . "&ver=$ver";
echo "\n";
}
@@ -637,7 +637,7 @@ function wp_print_admin_styles() {
}
function script_concat_settings() {
- global $concatenate_scripts, $compress_scripts;
+ global $concatenate_scripts, $compress_scripts, $compress_css;
$concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;
if ( $concatenate_scripts && -1 == get_option('concatenate_scripts') )
@@ -646,6 +646,10 @@ function script_concat_settings() {
$compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;
if ( $compress_scripts && ! get_option('can_compress_scripts') )
$compress_scripts = false;
+
+ $compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true;
+ if ( $compress_css && ! get_option('can_compress_scripts') )
+ $compress_css = false;
}
add_action( 'wp_default_scripts', 'wp_default_scripts' );