Code Duplication    Length = 5-7 lines in 2 locations

src/wp-admin/includes/user.php 1 location

@@ 101-107 (lines=7) @@
98
99
		if ( isset( $_POST['locale'] ) ) {
100
			$locale = sanitize_text_field( $_POST['locale'] );
101
			if ( 'site-default' === $locale ) {
102
				$locale = '';
103
			} elseif ( '' === $locale ) {
104
				$locale = 'en_US';
105
			} elseif ( ! in_array( $locale, get_available_languages(), true ) ) {
106
				$locale = '';
107
			}
108
109
			$user->locale = $locale;
110
		}

src/wp-admin/user-edit.php 1 location

@@ 298-302 (lines=5) @@
295
		<?php
296
		$user_locale = $profileuser->locale;
297
298
		if ( 'en_US' === $user_locale ) {
299
			$user_locale = '';
300
		} elseif ( '' === $user_locale || ! in_array( $user_locale, $languages, true ) ) {
301
			$user_locale = 'site-default';
302
		}
303
304
		wp_dropdown_languages( array(
305
			'name'                        => 'locale',