Make WordPress Core


Ignore:
Timestamp:
10/13/2015 12:29:18 AM (10 years ago)
Author:
SergeyBiryukov
Message:

In number_format_i18n(), check if $wp_locale is set before using it.

Props pauldewouters.
Fixes #31553.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r34985 r35092  
    172172function number_format_i18n( $number, $decimals = 0 ) {
    173173    global $wp_locale;
    174     $formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
     174
     175    if ( isset( $wp_locale ) ) {
     176        $formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
     177    } else {
     178        $formatted = number_format( $number, absint( $decimals ) );
     179    }
    175180
    176181    /**
Note: See TracChangeset for help on using the changeset viewer.