Code Duplication    Length = 12-12 lines in 2 locations

Sources/Subs.php 2 locations

@@ 3586-3597 (lines=12) @@
3583
		$mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.');
3584
		$max = ($mode == ':' ? 'ffff' : '255');
3585
		$min = 0;
3586
		if(!$valid_low)
3587
		{
3588
			$ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]);
3589
			$valid_low = isValidIP($ip_parts[0]);
3590
			while (!$valid_low)
3591
			{
3592
				$ip_parts[0] .= $mode . $min;
3593
				$valid_low = isValidIP($ip_parts[0]);
3594
				$count++;
3595
				if ($count > 9) break;
3596
			}
3597
		}
3598
3599
		$count = 0;
3600
		if(!$valid_high)
@@ 3600-3611 (lines=12) @@
3597
		}
3598
3599
		$count = 0;
3600
		if(!$valid_high)
3601
		{
3602
			$ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]);
3603
			$valid_high = isValidIP($ip_parts[1]);
3604
			while (!$valid_high)
3605
			{
3606
				$ip_parts[1] .= $mode . $max;
3607
				$valid_high = isValidIP($ip_parts[1]);
3608
				$count++;
3609
				if ($count > 9) break;
3610
			}
3611
		}
3612
3613
		if($valid_high && $valid_low)
3614
		{