WordPress.org

Make WordPress Core

Changeset 12214


Ignore:
Timestamp:
11/19/09 09:46:07 (4 years ago)
Author:
azaozz
Message:

Check if $_SERVERHTTP_ACCEPT_ENCODING? is set before determining whether to compress scripts, props nacin, fixes #11169

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r12196 r12214  
    9292            die; 
    9393         } elseif ( 2 == $_GET['test'] ) { 
     94            if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) 
     95                die('-1'); 
    9496            if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { 
    9597                header('Content-Encoding: deflate'); 
  • trunk/wp-admin/load-scripts.php

    r11204 r12214  
    128128header("Cache-Control: public, max-age=$expires_offset"); 
    129129 
    130 if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') ) { 
     130if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { 
    131131    header('Vary: Accept-Encoding'); // Handle proxies 
    132132    if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { 
  • trunk/wp-admin/load-styles.php

    r11204 r12214  
    138138header("Cache-Control: public, max-age=$expires_offset"); 
    139139 
    140 if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') ) { 
     140if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) { 
    141141    header('Vary: Accept-Encoding'); // Handle proxies 
    142142    if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) { 
  • trunk/wp-includes/js/tinymce/wp-tinymce.php

    r11589 r12214  
    11<?php 
     2/** 
     3 * Disable error reporting 
     4 * 
     5 * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging 
     6 */ 
     7error_reporting(0); 
    28 
    39$basepath = dirname(__FILE__); 
     
    2127header("Cache-Control: public, max-age=$expires_offset"); 
    2228 
    23 if ( isset($_GET['c']) && 1 == $_GET['c'] && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) { 
     29if ( isset($_GET['c']) && 1 == $_GET['c'] && isset($_SERVER['HTTP_ACCEPT_ENCODING']) 
     30    && false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && ( $file = get_file($basepath . '/wp-tinymce.js.gz') ) ) { 
     31 
    2432    header('Content-Encoding: gzip'); 
    2533    echo $file; 
Note: See TracChangeset for help on using the changeset viewer.