Code Duplication    Length = 10-11 lines in 2 locations

json-endpoints/class.wpcom-json-api-get-site-endpoint.php 1 location

@@ 455-464 (lines=10) @@
452
453
	}
454
455
	protected function process_locale( $key, $is_user_logged_in ) {
456
		if ( $is_user_logged_in && 'lang' == $key ) {
457
			if ( is_jetpack_site() ) {
458
				return (string) get_bloginfo( 'language' );
459
			} elseif ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
460
				return (string) get_blog_lang_code();
461
			}
462
		}
463
		return false;
464
	}
465
466
	function force_http( $url, $scheme, $orig_scheme ) {
467
		return preg_replace('/^https:\/\//', 'http://', $url, 1 );

json-endpoints/class.wpcom-json-api-site-settings-endpoint.php 1 location

@@ 213-223 (lines=11) @@
210
211
	}
212
213
	protected function get_locale( $key ) {
214
		if ( 'lang' == $key ) {
215
			if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
216
				return (string) get_blog_lang_code();
217
			} else {
218
				return get_locale();
219
			}
220
		}
221
222
		return false;
223
	}
224
225
226
	/**