From 19864318cc1261d6215859cf4afe19d976c00a69 Mon Sep 17 00:00:00 2001
From: Sergey Biryukov
Date: Mon, 30 Nov 2020 13:40:02 +0000
Subject: [PATCH] Upgrade/Install: Display "You are using a development
version" message on WordPress Updates screen for Beta or RC versions.
This ensures that the message is displayed when the `WP_AUTO_UPDATE_CORE` constant is set to `beta` or `rc` and the user is on a development version.
Follow-up to [49245], [49254], [49292], [49638], [49708].
Props afragen, audrasjb, azaozz, SergeyBiryukov.
Fixes #51822.
git-svn-id: https://develop.svn.wordpress.org/trunk@49709 602fd350-edb4-49c9-b593-d223f7449a82
---
src/wp-admin/update-core.php | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php
index 8521bfd9e4..d3e7f2cd46 100644
--- a/src/wp-admin/update-core.php
+++ b/src/wp-admin/update-core.php
@@ -229,8 +229,12 @@ function dismissed_updates() {
function core_upgrade_preamble() {
global $required_php_version, $required_mysql_version;
- $wp_version = get_bloginfo( 'version' );
- $updates = get_core_updates();
+ $updates = get_core_updates();
+
+ // Include an unmodified $wp_version.
+ require ABSPATH . WPINC . '/version.php';
+
+ $is_development_version = preg_match( '/alpha|beta|RC/', $wp_version );
if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) {
echo '';
@@ -245,7 +249,7 @@ function core_upgrade_preamble() {
__( 'https://wordpress.org/support/article/updating-wordpress/' )
);
echo '
';
- } elseif ( isset( $updates[0] ) && 'development' === $updates[0]->response ) {
+ } elseif ( $is_development_version ) {
echo '' . __( 'You are using a development version of WordPress.' ) . '
';
} else {
echo '' . __( 'You have the latest version of WordPress.' ) . '
';