Upgrade/Install: Pass the full database version string to WordPress.org for parsing.

This aims to make the provided statistical data more complete, by correctly identifying the version for a wider selection of database types and servers.

Props mukesh27, costdev, spacedmonkey, johnbillion.
Fixes #58584.


git-svn-id: https://develop.svn.wordpress.org/trunk@56050 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2023-06-27 05:09:52 +00:00
parent 12ed5ccb0a
commit 44a71b595e

View File

@ -74,7 +74,9 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
$current->last_checked = time();
set_site_transient( 'update_core', $current );
if ( method_exists( $wpdb, 'db_version' ) ) {
if ( method_exists( $wpdb, 'db_server_info' ) ) {
$mysql_version = $wpdb->db_server_info();
} elseif ( method_exists( $wpdb, 'db_version' ) ) {
$mysql_version = preg_replace( '/[^0-9.].*/', '', $wpdb->db_version() );
} else {
$mysql_version = 'N/A';