Code Duplication    Length = 12-12 lines in 2 locations

Sources/ManageServer.php 2 locations

@@ 1203-1214 (lines=12) @@
1200
			$setArray[$var[1]] = !empty($lOptions) ? implode(',', $lOptions) : '';
1201
		}
1202
		// Integers!
1203
		elseif ($var[0] == 'int')
1204
		{
1205
			$setArray[$var[1]] = (int) $_POST[$var[1]];
1206
1207
			// 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...
1208
			$min = isset($var['min']) ? $var['min'] : 0;
1209
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1210
1211
			// Do we have a max value for this as well?
1212
			if (isset($var['max']))
1213
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1214
		}
1215
		// Floating point!
1216
		elseif ($var[0] == 'float')
1217
		{
@@ 1216-1227 (lines=12) @@
1213
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1214
		}
1215
		// Floating point!
1216
		elseif ($var[0] == 'float')
1217
		{
1218
			$setArray[$var[1]] = (float) $_POST[$var[1]];
1219
1220
			// 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...
1221
			$min = isset($var['min']) ? $var['min'] : 0;
1222
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1223
1224
			// Do we have a max value for this as well?
1225
			if (isset($var['max']))
1226
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1227
		}
1228
		// Text!
1229
		elseif (in_array($var[0], array('text', 'large_text', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time')))
1230
			$setArray[$var[1]] = $_POST[$var[1]];