Code Duplication    Length = 12-12 lines in 2 locations

Sources/ManageServer.php 2 locations

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