WordPress.org

Make WordPress Core

Ticket #44815: 44815.diff

File 44815.diff, 2.7 KB (added by LucasRolff, 3 years ago)

patch for ticket #44815

  • src/wp-admin/load-scripts.php

    diff --git a/src/wp-admin/load-scripts.php b/src/wp-admin/load-scripts.php
    index 8a0ee3c17f..e3d6da2fc3 100644
    a b require( ABSPATH . 'wp-admin/includes/noop.php' ); 
    3030require( ABSPATH . WPINC . '/script-loader.php' );
    3131require( ABSPATH . WPINC . '/version.php' );
    3232
    33 $compress       = ( isset( $_GET['c'] ) && $_GET['c'] );
    34 $force_gzip     = ( $compress && 'gzip' == $_GET['c'] );
    3533$expires_offset = 31536000; // 1 year
    3634$out            = '';
    3735
    header( 'Content-Type: application/javascript; charset=UTF-8' ); 
    6159header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
    6260header( "Cache-Control: public, max-age=$expires_offset" );
    6361
    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 proxies
    66         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 
    7562echo $out;
    7663exit;
  • src/wp-admin/load-styles.php

    diff --git a/src/wp-admin/load-styles.php b/src/wp-admin/load-styles.php
    index 82dacef60a..d6c5afc330 100644
    a b if ( empty( $load ) ) { 
    2929        exit;
    3030}
    3131
    32 $compress       = ( isset( $_GET['c'] ) && $_GET['c'] );
    33 $force_gzip     = ( $compress && 'gzip' == $_GET['c'] );
    3432$rtl            = ( isset( $_GET['dir'] ) && 'rtl' == $_GET['dir'] );
    3533$expires_offset = 31536000; // 1 year
    3634$out            = '';
    header( 'Content-Type: text/css; charset=UTF-8' ); 
    8280header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
    8381header( "Cache-Control: public, max-age=$expires_offset" );
    8482
    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 proxies
    87         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 
    9683echo $out;
    9784exit;