Code Duplication    Length = 12-12 lines in 2 locations

Sources/ManageServer.php 2 locations

@@ 1357-1368 (lines=12) @@
1354
			$setArray[$var[1]] = !empty($lOptions) ? implode(',', $lOptions) : '';
1355
		}
1356
		// Integers!
1357
		elseif ($var[0] == 'int')
1358
		{
1359
			$setArray[$var[1]] = (int) $_POST[$var[1]];
1360
1361
			// 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...
1362
			$min = isset($var['min']) ? $var['min'] : 0;
1363
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1364
1365
			// Do we have a max value for this as well?
1366
			if (isset($var['max']))
1367
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1368
		}
1369
		// Floating point!
1370
		elseif ($var[0] == 'float')
1371
		{
@@ 1370-1381 (lines=12) @@
1367
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1368
		}
1369
		// Floating point!
1370
		elseif ($var[0] == 'float')
1371
		{
1372
			$setArray[$var[1]] = (float) $_POST[$var[1]];
1373
1374
			// 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...
1375
			$min = isset($var['min']) ? $var['min'] : 0;
1376
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1377
1378
			// Do we have a max value for this as well?
1379
			if (isset($var['max']))
1380
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1381
		}
1382
		// Text!
1383
		elseif (in_array($var[0], array('text', 'large_text', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time')))
1384
			$setArray[$var[1]] = $_POST[$var[1]];