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.
Built from https://develop.svn.wordpress.org/trunk@52395


git-svn-id: http://core.svn.wordpress.org/trunk@51987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2021-12-20 23:53:01 +00:00
parent ea138fdcb9
commit a3dedd1d4d
2 changed files with 5 additions and 3 deletions

View File

@ -2235,6 +2235,8 @@ function script_concat_settings() {
$compressed_output = ( ini_get( 'zlib.output_compression' ) || 'ob_gzhandler' === ini_get( 'output_handler' ) );
$can_compress_scripts = ! wp_installing() && get_site_option( 'can_compress_scripts' );
if ( ! isset( $concatenate_scripts ) ) {
$concatenate_scripts = defined( 'CONCATENATE_SCRIPTS' ) ? CONCATENATE_SCRIPTS : true;
if ( ( ! is_admin() && ! did_action( 'login_init' ) ) || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) {
@ -2244,14 +2246,14 @@ function script_concat_settings() {
if ( ! isset( $compress_scripts ) ) {
$compress_scripts = defined( 'COMPRESS_SCRIPTS' ) ? COMPRESS_SCRIPTS : true;
if ( $compress_scripts && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {
if ( $compress_scripts && ( ! $can_compress_scripts || $compressed_output ) ) {
$compress_scripts = false;
}
}
if ( ! isset( $compress_css ) ) {
$compress_css = defined( 'COMPRESS_CSS' ) ? COMPRESS_CSS : true;
if ( $compress_css && ( ! get_site_option( 'can_compress_scripts' ) || $compressed_output ) ) {
if ( $compress_css && ( ! $can_compress_scripts || $compressed_output ) ) {
$compress_css = false;
}
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-beta3-52394';
$wp_version = '5.9-beta3-52395';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.