Code Duplication    Length = 12-12 lines in 2 locations

Sources/ManageServer.php 2 locations

@@ 1378-1389 (lines=12) @@
1375
			$setArray[$var[1]] = !empty($lOptions) ? implode(',', $lOptions) : '';
1376
		}
1377
		// Integers!
1378
		elseif ($var[0] == 'int')
1379
		{
1380
			$setArray[$var[1]] = (int) $_POST[$var[1]];
1381
1382
			// If no min is specified, assume 0. This is done to avoid having to specify 'min => 0' for all settings where 0 is the min...
1383
			$min = isset($var['min']) ? $var['min'] : 0;
1384
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1385
1386
			// Do we have a max value for this as well?
1387
			if (isset($var['max']))
1388
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1389
		}
1390
		// Floating point!
1391
		elseif ($var[0] == 'float')
1392
		{
@@ 1391-1402 (lines=12) @@
1388
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1389
		}
1390
		// Floating point!
1391
		elseif ($var[0] == 'float')
1392
		{
1393
			$setArray[$var[1]] = (float) $_POST[$var[1]];
1394
1395
			// If no min is specified, assume 0. This is done to avoid having to specify 'min => 0' for all settings where 0 is the min...
1396
			$min = isset($var['min']) ? $var['min'] : 0;
1397
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1398
1399
			// Do we have a max value for this as well?
1400
			if (isset($var['max']))
1401
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1402
		}
1403
		// Text!
1404
		elseif (in_array($var[0], array('text', 'large_text', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time')))
1405
			$setArray[$var[1]] = $_POST[$var[1]];