Ticket #43308: 43308.patch
File 43308.patch, 2.5 KB (added by , 7 years ago) |
---|
-
src/wp-admin/load-scripts.php
30 30 require( ABSPATH . WPINC . '/script-loader.php' ); 31 31 require( ABSPATH . WPINC . '/version.php' ); 32 32 33 $compress = ( isset( $_GET['c'] ) && $_GET['c'] );34 $force_gzip = ( $compress && 'gzip' == $_GET['c'] );35 33 $expires_offset = 31536000; // 1 year 36 34 $out = ''; 37 35 … … 61 59 header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); 62 60 header( "Cache-Control: public, max-age=$expires_offset" ); 63 61 64 if ( $compress && ! ini_get( 'zlib.output_compression' ) && 'ob_gzhandler' != ini_get( 'output_handler' ) && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {65 header( 'Vary: Accept-Encoding' ); // Handle proxies66 if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate' ) && function_exists( 'gzdeflate' ) && ! $force_gzip ) {67 header( 'Content-Encoding: deflate' );68 $out = gzdeflate( $out, 3 );69 } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && function_exists( 'gzencode' ) ) {70 header( 'Content-Encoding: gzip' );71 $out = gzencode( $out, 3 );72 }73 }74 75 62 echo $out; 76 63 exit; -
src/wp-admin/load-styles.php
29 29 exit; 30 30 } 31 31 32 $compress = ( isset( $_GET['c'] ) && $_GET['c'] );33 $force_gzip = ( $compress && 'gzip' == $_GET['c'] );34 32 $rtl = ( isset( $_GET['dir'] ) && 'rtl' == $_GET['dir'] ); 35 33 $expires_offset = 31536000; // 1 year 36 34 $out = ''; … … 82 80 header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); 83 81 header( "Cache-Control: public, max-age=$expires_offset" ); 84 82 85 if ( $compress && ! ini_get( 'zlib.output_compression' ) && 'ob_gzhandler' != ini_get( 'output_handler' ) && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {86 header( 'Vary: Accept-Encoding' ); // Handle proxies87 if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate' ) && function_exists( 'gzdeflate' ) && ! $force_gzip ) {88 header( 'Content-Encoding: deflate' );89 $out = gzdeflate( $out, 3 );90 } elseif ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && function_exists( 'gzencode' ) ) {91 header( 'Content-Encoding: gzip' );92 $out = gzencode( $out, 3 );93 }94 }95 96 83 echo $out; 97 84 exit;