Check if a locale category is an existing constant when restoring locale settings in Tests_DB::test_locale_floats(). props nofearinc. fixes #25118.

git-svn-id: https://develop.svn.wordpress.org/trunk@25084 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-08-22 15:28:01 +00:00
parent 5ea9e40fed
commit ac338fc070
1 changed files with 2 additions and 1 deletions

View File

@ -79,7 +79,8 @@ class Tests_DB extends WP_UnitTestCase {
foreach ( $current_locales as $locale_setting ) {
if ( false !== strpos( $locale_setting, '=' ) ) {
list( $category, $locale ) = explode( '=', $locale_setting );
setlocale( constant( $category ), $locale );
if ( defined( $category ) )
setlocale( constant( $category ), $locale );
} else {
setlocale( LC_ALL, $locale_setting );
}