Code Duplication    Length = 12-12 lines in 2 locations

Sources/Subs.php 2 locations

@@ 3788-3799 (lines=12) @@
3785
		$mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.');
3786
		$max = ($mode == ':' ? 'ffff' : '255');
3787
		$min = 0;
3788
		if(!$valid_low)
3789
		{
3790
			$ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]);
3791
			$valid_low = isValidIP($ip_parts[0]);
3792
			while (!$valid_low)
3793
			{
3794
				$ip_parts[0] .= $mode . $min;
3795
				$valid_low = isValidIP($ip_parts[0]);
3796
				$count++;
3797
				if ($count > 9) break;
3798
			}
3799
		}
3800
3801
		$count = 0;
3802
		if(!$valid_high)
@@ 3802-3813 (lines=12) @@
3799
		}
3800
3801
		$count = 0;
3802
		if(!$valid_high)
3803
		{
3804
			$ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]);
3805
			$valid_high = isValidIP($ip_parts[1]);
3806
			while (!$valid_high)
3807
			{
3808
				$ip_parts[1] .= $mode . $max;
3809
				$valid_high = isValidIP($ip_parts[1]);
3810
				$count++;
3811
				if ($count > 9) break;
3812
			}
3813
		}
3814
3815
		if($valid_high && $valid_low)
3816
		{