Code Duplication    Length = 12-12 lines in 2 locations

Sources/ManageServer.php 2 locations

@@ 1174-1185 (lines=12) @@
1171
			$setArray[$var[1]] = !empty($lOptions) ? implode(',', $lOptions) : '';
1172
		}
1173
		// Integers!
1174
		elseif ($var[0] == 'int')
1175
		{
1176
			$setArray[$var[1]] = (int) $_POST[$var[1]];
1177
1178
			// 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...
1179
			$min = isset($var['min']) ? $var['min'] : 0;
1180
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1181
1182
			// Do we have a max value for this as well?
1183
			if (isset($var['max']))
1184
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1185
		}
1186
		// Floating point!
1187
		elseif ($var[0] == 'float')
1188
		{
@@ 1187-1198 (lines=12) @@
1184
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1185
		}
1186
		// Floating point!
1187
		elseif ($var[0] == 'float')
1188
		{
1189
			$setArray[$var[1]] = (float) $_POST[$var[1]];
1190
1191
			// 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...
1192
			$min = isset($var['min']) ? $var['min'] : 0;
1193
			$setArray[$var[1]] = max($min, $setArray[$var[1]]);
1194
1195
			// Do we have a max value for this as well?
1196
			if (isset($var['max']))
1197
				$setArray[$var[1]] = min($var['max'], $setArray[$var[1]]);
1198
		}
1199
		// Text!
1200
		elseif (in_array($var[0], array('text', 'large_text', 'color', 'date', 'datetime', 'datetime-local', 'email', 'month', 'time')))
1201
			$setArray[$var[1]] = $_POST[$var[1]];