Make WordPress Core

Changeset 52395


Ignore:
Timestamp:
12/20/2021 11:51:35 PM (3 years ago)
Author:
hellofromTonya
Message:

Script Loader: Skip getting 'can_compress_scripts' option in script_concat_settings() during install.

When installing a multisite, there is a potential access to a non-existent database table that needs to be skipped to avoid warnings/errors. This fix checks is WordPress is not installing before getting the 'can_compress_scripts' option.

Props schlessera.
Fixes #54634.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r52364 r52395  
    22362236    $compressed_output = ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' === ini_get( 'output_handler' ) );
    22372237
     2238    $can_compress_scripts = ! wp_installing() && get_site_option( 'can_compress_scripts' );
     2239
    22382240    if ( ! isset( $concatenate_scripts ) ) {
    22392241        $concatenate_scripts = defined( 'CONCATENATE_SCRIPTS' ) ? CONCATENATE_SCRIPTS : true;
     
    22452247    if ( ! isset( $compress_scripts ) ) {
    22462248        $compress_scripts = defined( 'COMPRESS_SCRIPTS' ) ? COMPRESS_SCRIPTS : true;
    2247         if ( $compress_scripts && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {
     2249        if ( $compress_scripts && ( ! $can_compress_scripts || $compressed_output ) ) {
    22482250            $compress_scripts = false;
    22492251        }
     
    22522254    if ( ! isset( $compress_css ) ) {
    22532255        $compress_css = defined( 'COMPRESS_CSS' ) ? COMPRESS_CSS : true;
    2254         if ( $compress_css && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {
     2256        if ( $compress_css && ( ! $can_compress_scripts || $compressed_output ) ) {
    22552257            $compress_css = false;
    22562258        }
Note: See TracChangeset for help on using the changeset viewer.