From 7ef095171a7b0acc8f318d421d969a5fb8cf5e6c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 13 Oct 2015 00:30:24 +0000 Subject: [PATCH] In `number_format_i18n()`, check if `$wp_locale` is set before using it. Props pauldewouters. Fixes #31553. Built from https://develop.svn.wordpress.org/trunk@35092 git-svn-id: http://core.svn.wordpress.org/trunk@35057 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 7 ++++++- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 1381038418..a617cb0110 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -171,7 +171,12 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { */ function number_format_i18n( $number, $decimals = 0 ) { global $wp_locale; - $formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] ); + + if ( isset( $wp_locale ) ) { + $formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] ); + } else { + $formatted = number_format( $number, absint( $decimals ) ); + } /** * Filter the number formatted based on the locale. diff --git a/wp-includes/version.php b/wp-includes/version.php index d976203366..d217940673 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35091'; +$wp_version = '4.4-alpha-35092'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.