Changeset 56003
- Timestamp:
- 06/23/2023 04:01:08 PM (18 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r55990 r56003 146 146 $determined_locale = sanitize_locale_name( $_COOKIE['wp_lang'] ); 147 147 } 148 } else 149 ( isset( $_GET['_locale'] ) && 'user' === $_GET['_locale'] && wp_is_json_request()) ||150 is_admin()148 } elseif ( 149 is_admin() || 150 ( isset( $_GET['_locale'] ) && 'user' === $_GET['_locale'] && wp_is_json_request() ) 151 151 ) { 152 152 $determined_locale = get_user_locale(); 153 } else { 153 } 154 155 if ( ! $determined_locale ) { 154 156 $determined_locale = get_locale(); 155 157 } -
trunk/tests/phpunit/tests/l10n/determineLocale.php
r55862 r56003 212 212 } 213 213 214 public function test_wp_login_get_param_on_login_page_incorrect_string() { 215 add_filter( 216 'locale', 217 static function() { 218 return 'siteLocale'; 219 } 220 ); 221 222 wp_set_current_user( self::$user_id ); 223 224 $GLOBALS['pagenow'] = 'wp-login.php'; 225 $_GET['wp_lang'] = '###'; // Something sanitize_locale_name() strips away. 226 227 $this->assertSame( 'siteLocale', determine_locale() ); 228 } 229 214 230 public function test_wp_login_cookie_not_on_login_page() { 215 231 add_filter(
Note: See TracChangeset
for help on using the changeset viewer.