Ticket #14553: 14553.2.diff

File 14553.2.diff, 1.4 KB (added by nacin, 3 years ago)

Addresses faulty logic.

Line 
1Index: wp-includes/update.php
2===================================================================
3--- wp-includes/update.php      (revision 15591)
4+++ wp-includes/update.php      (working copy)
5@@ -33,7 +33,7 @@
6                $current->version_checked = $wp_version;
7        }
8 
9-       $locale = apply_filters( 'core_version_check_locale', get_locale() );
10+       $locale = apply_filters( 'core_version_check_locale', get_locale( true ) );
11 
12        // Update last_checked for current to prevent multiple blocking requests if request hangs
13        $current->last_checked = time();
14Index: wp-includes/l10n.php
15===================================================================
16--- wp-includes/l10n.php        (revision 15590)
17+++ wp-includes/l10n.php        (working copy)
18@@ -23,9 +23,11 @@
19  * @uses apply_filters() Calls 'locale' hook on locale value.
20  * @uses $locale Gets the locale stored in the global.
21  *
22+ * @param bool $network Whether to retrieve the network wide setting when running
23+ *     multisite. Optional, default false.
24  * @return string The locale of the blog or from the 'locale' hook.
25  */
26-function get_locale() {
27+function get_locale( $network = false ) {
28        global $locale;
29 
30        if ( isset( $locale ) )
31@@ -38,7 +40,7 @@
32        // If multisite, check options.
33        if ( is_multisite() && !defined('WP_INSTALLING') ) {
34                $ms_locale = get_option('WPLANG');
35-               if ( $ms_locale === false )
36+               if ( $network || false === $ms_locale )
37                        $ms_locale = get_site_option('WPLANG');
38 
39                if ( $ms_locale !== false )