Code Duplication    Length = 12-12 lines in 2 locations

Sources/Subs.php 2 locations

@@ 3597-3608 (lines=12) @@
3594
		$mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.');
3595
		$max = ($mode == ':' ? 'ffff' : '255');
3596
		$min = 0;
3597
		if(!$valid_low)
3598
		{
3599
			$ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]);
3600
			$valid_low = isValidIP($ip_parts[0]);
3601
			while (!$valid_low)
3602
			{
3603
				$ip_parts[0] .= $mode . $min;
3604
				$valid_low = isValidIP($ip_parts[0]);
3605
				$count++;
3606
				if ($count > 9) break;
3607
			}
3608
		}
3609
3610
		$count = 0;
3611
		if(!$valid_high)
@@ 3611-3622 (lines=12) @@
3608
		}
3609
3610
		$count = 0;
3611
		if(!$valid_high)
3612
		{
3613
			$ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]);
3614
			$valid_high = isValidIP($ip_parts[1]);
3615
			while (!$valid_high)
3616
			{
3617
				$ip_parts[1] .= $mode . $max;
3618
				$valid_high = isValidIP($ip_parts[1]);
3619
				$count++;
3620
				if ($count > 9) break;
3621
			}
3622
		}
3623
3624
		if($valid_high && $valid_low)
3625
		{