Make WordPress Core

Changeset 56152


Ignore:
Timestamp:
07/06/2023 01:52:56 PM (3 years ago)
Author:
audrasjb
Message:

Boostrap/Load: Incorrect condition in wp_check_php_mysql_versions().

This changeset adds a check for the existence of db.php at the default path ABSPATH . 'wp-content/db.php', even if WP_CONTENT_DIR is defined and db.php
is placed in WP_CONTENT_DIR.

Follow-up to [49161].

Props mikeyzm, SergeyBiryukov, hztyfoon,
Fixes #58201.

File:
1 edited

Legend:

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

    r56065 r56152  
    163163        }
    164164
    165         if ( ! function_exists( 'mysqli_connect' ) && ! function_exists( 'mysql_connect' )
    166                 // This runs before default constants are defined, so we can't assume WP_CONTENT_DIR is set yet.
    167                 && ( defined( 'WP_CONTENT_DIR' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' )
    168                         || ! file_exists( ABSPATH . 'wp-content/db.php' ) )
     165        // This runs before default constants are defined, so we can't assume WP_CONTENT_DIR is set yet.
     166        $wp_content_dir = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content';
     167
     168        if ( ! function_exists( 'mysqli_connect' )
     169                && ! function_exists( 'mysql_connect' )
     170                && ! file_exists( $wp_content_dir . '/db.php' )
    169171        ) {
    170172                require_once ABSPATH . WPINC . '/functions.php';
Note: See TracChangeset for help on using the changeset viewer.