Code Duplication    Length = 7-7 lines in 2 locations

modules/protect/shared-functions.php 2 locations

@@ 18-24 (lines=7) @@
15
	$formatted = array(
16
		'local' => array(),
17
	);
18
	foreach ( $local_whitelist as $item ) {
19
		if ( $item->range ) {
20
			$formatted['local'][] = $item->range_low . ' - ' . $item->range_high;
21
		} else {
22
			$formatted['local'][] = $item->ip_address;
23
		}
24
	}
25
	if ( is_multisite() && current_user_can( 'manage_network' ) ) {
26
		$formatted['global'] = array();
27
		$global_whitelist    = jetpack_protect_get_global_whitelist();
@@ 32-38 (lines=7) @@
29
			// If the global whitelist has never been set, check for a legacy option set prior to 3.6.
30
			$global_whitelist = get_site_option( 'jetpack_protect_whitelist', array() );
31
		}
32
		foreach ( $global_whitelist as $item ) {
33
			if ( $item->range ) {
34
				$formatted['global'][] = $item->range_low . ' - ' . $item->range_high;
35
			} else {
36
				$formatted['global'][] = $item->ip_address;
37
			}
38
		}
39
	}
40
	return $formatted;
41
}