Changeset 10372
- Timestamp:
- 01/17/2009 02:08:15 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/load-scripts.php
r10357 r10372 86 86 } 87 87 88 // Discard any buffers 89 while ( @ob_end_clean() ); 90 88 91 if ( isset($_GET['test']) && 1 == $_GET['test'] ) { 89 92 if ( ini_get('zlib.output_compression') ) 90 93 exit(''); 91 92 $out = 'var wpCompressionTest = 1;';93 94 94 $compressed = false; 95 if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') ) { 96 header('Content-Encoding: deflate'); 97 $out = gzdeflate( $out, 3 ); 98 $compressed = true; 99 } elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) { 95 if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) { 100 96 header('Content-Encoding: gzip'); 101 $out = gzencode( $out, 3 ); 102 $compressed = true; 97 $out = gzencode( 'var wpCompressionTest = 1;', 3 ); 103 98 } 104 99 105 if ( ! $compressed)100 if ( ! isset($out) ) 106 101 exit(''); 107 102 … … 124 119 require(ABSPATH . '/wp-includes/version.php'); 125 120 126 // Discard any buffers127 while ( @ob_end_clean() );128 129 121 $compress = ( isset($_GET['c']) && 1 == $_GET['c'] ); 130 122 $expires_offset = 31536000; … … 143 135 144 136 header('Content-Type: application/x-javascript; charset=UTF-8'); 145 header('Vary: Accept-Encoding'); // Handle proxies146 137 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); 147 138 header("Cache-Control: public, max-age=$expires_offset"); 148 139 149 if ( $compress && ! ini_get('zlib.output_compression') ) { 150 if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') ) { 151 header('Content-Encoding: deflate'); 152 $out = gzdeflate( $out, 3 ); 153 } elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) { 140 if ( $compress && ! ini_get('zlib.output_compression') && function_exists('gzencode') ) { 141 header('Vary: Accept-Encoding'); // Handle proxies 142 if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) { 154 143 header('Content-Encoding: gzip'); 155 144 $out = gzencode( $out, 3 ); -
trunk/wp-admin/load-styles.php
r10357 r10372 124 124 125 125 header('Content-Type: text/css'); 126 header('Vary: Accept-Encoding'); // Handle proxies127 126 header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); 128 127 header("Cache-Control: public, max-age=$expires_offset"); 129 128 130 if ( $compress && ! ini_get('zlib.output_compression') ) { 131 if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') ) { 132 header('Content-Encoding: deflate'); 133 $out = gzdeflate( $out, 3 ); 134 } elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) { 129 if ( $compress && ! ini_get('zlib.output_compression') && function_exists('gzencode') ) { 130 header('Vary: Accept-Encoding'); // Handle proxies 131 if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) { 135 132 header('Content-Encoding: gzip'); 136 133 $out = gzencode( $out, 3 ); -
trunk/wp-includes/js/tinymce/wp-tinymce.php
r10369 r10372 1 1 <?php 2 3 $basepath = dirname(__FILE__); 2 4 3 5 while ( @ob_end_clean() ); … … 23 25 if ( isset($_GET['c']) && 1 == $_GET['c'] && ! ini_get('zlib.output_compression') && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') ) { 24 26 header('Content-Encoding: gzip'); 25 echo get_file( 'wp-tinymce.js.gz');27 echo get_file($basepath . '/wp-tinymce.js.gz'); 26 28 } else { 27 echo get_file( 'wp-tinymce.js');29 echo get_file($basepath . '/wp-tinymce.js'); 28 30 } 29 31 exit; -
trunk/wp-includes/script-loader.php
r10368 r10372 597 597 598 598 $ver = md5("$wp_scripts->concat" . "$wp_scripts->concat_version"); 599 $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}& amp;load=" . rtrim($wp_scripts->concat, ',') . "&ver=$ver";599 $src = $wp_scripts->base_url . "/wp-admin/load-scripts.php?c={$zip}&load=" . rtrim($wp_scripts->concat, ',') . "&ver=$ver"; 600 600 echo "<script type='text/javascript' src='$src'></script>\n"; 601 601 } … … 607 607 608 608 function wp_print_admin_styles() { 609 global $wp_styles, $concatenate_scripts, $compress_ scripts;609 global $wp_styles, $concatenate_scripts, $compress_css; 610 610 611 611 if ( !is_a($wp_styles, 'WP_Styles') ) … … 616 616 617 617 $wp_styles->do_concat = $concatenate_scripts; 618 $zip = $compress_ scripts ? 1 : 0;618 $zip = $compress_css ? 1 : 0; 619 619 620 620 $wp_styles->do_items(false); … … 624 624 $ver = md5("$wp_styles->concat" . "$wp_styles->concat_version"); 625 625 $rtl = 'rtl' === $wp_styles->text_direction ? 1 : 0; 626 $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}& amp;rtl={$rtl}&load=" . rtrim($wp_styles->concat, ',') . "&ver=$ver";626 $href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&rtl={$rtl}&load=" . rtrim($wp_styles->concat, ',') . "&ver=$ver"; 627 627 echo "<link rel='stylesheet' href='$href' type='text/css' media='all' />\n"; 628 628 } … … 638 638 639 639 function script_concat_settings() { 640 global $concatenate_scripts, $compress_scripts ;640 global $concatenate_scripts, $compress_scripts, $compress_css; 641 641 642 642 $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true; … … 647 647 if ( $compress_scripts && ! get_option('can_compress_scripts') ) 648 648 $compress_scripts = false; 649 650 $compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true; 651 if ( $compress_css && ! get_option('can_compress_scripts') ) 652 $compress_css = false; 649 653 } 650 654
Note: See TracChangeset
for help on using the changeset viewer.