Code Duplication    Length = 12-12 lines in 2 locations

Sources/ManageServer.php 2 locations

@@ 1186-1197 (lines=12) @@
1183
			$setArray[$var[1]] = !empty($lOptions) ? implode(',', $lOptions) : '';
1184
		}
1185
		// Integers!
1186
		elseif ($var[0] == 'int')
1187
		{
1188
			$setArray[$var[1]] = (int) $_POST[$var[1]];
1189
1190
			// 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...
1191
			$min = isset($var['min']) ? $var['min'] : 0;
1192
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1193
1194
			// Do we have a max value for this as well?
1195
			if (isset($var['max']))
1196
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1197
		}
1198
		// Floating point!
1199
		elseif ($var[0] == 'float')
1200
		{
@@ 1199-1210 (lines=12) @@
1196
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1197
		}
1198
		// Floating point!
1199
		elseif ($var[0] == 'float')
1200
		{
1201
			$setArray[$var[1]] = (float) $_POST[$var[1]];
1202
1203
			// 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...
1204
			$min = isset($var['min']) ? $var['min'] : 0;
1205
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1206
1207
			// Do we have a max value for this as well?
1208
			if (isset($var['max']))
1209
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1210
		}
1211
		// Text!
1212
		elseif (in_array($var[0], array('text', 'large_text', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time')))
1213
			$setArray[$var[1]] = $_POST[$var[1]];