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.



Built from https://develop.svn.wordpress.org/trunk@56152


git-svn-id: http://core.svn.wordpress.org/trunk@55664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-07-06 13:54:23 +00:00
parent 29791cad8c
commit b5a05e6558
2 changed files with 7 additions and 5 deletions

View File

@ -162,10 +162,12 @@ function wp_check_php_mysql_versions() {
exit( 1 );
}
if ( ! function_exists( 'mysqli_connect' ) && ! function_exists( 'mysql_connect' )
// This runs before default constants are defined, so we can't assume WP_CONTENT_DIR is set yet.
&& ( defined( 'WP_CONTENT_DIR' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' )
|| ! file_exists( ABSPATH . 'wp-content/db.php' ) )
// This runs before default constants are defined, so we can't assume WP_CONTENT_DIR is set yet.
$wp_content_dir = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content';
if ( ! function_exists( 'mysqli_connect' )
&& ! function_exists( 'mysql_connect' )
&& ! file_exists( $wp_content_dir . '/db.php' )
) {
require_once ABSPATH . WPINC . '/functions.php';
wp_load_translations_early();

View File

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