Skip to content

Commit d299360

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@56152 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c49225f commit d299360

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/wp-includes/load.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,12 @@ function wp_check_php_mysql_versions() {
162162
exit( 1 );
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';
171173
wp_load_translations_early();

0 commit comments

Comments
 (0)