Code Duplication    Length = 2-4 lines in 3 locations

Sources/Subs-Calendar.php 3 locations

@@ 1164-1167 (lines=4) @@
1161
	$allday = isset($_REQUEST['allday']) ? 1 : (isset($_REQUEST['start_time']) ? 0 : 1);
1162
	$span = isset($_REQUEST['span']) && filter_var($_REQUEST['span'], FILTER_VALIDATE_INT, array('options' => array('min_range' => 0))) ? $_REQUEST['span'] : 1;
1163
1164
	if (!empty($_REQUEST['tz']) && in_array($_REQUEST['tz'], timezone_identifiers_list(DateTimeZone::ALL_WITH_BC)))
1165
		$tz = $_REQUEST['tz'];
1166
	else
1167
		$tz = getUserTimezone();
1168
1169
	// Was the input given as individual parameters?
1170
	$start_year = isset($_REQUEST['year']) ? $_REQUEST['year'] : $today['year'];
@@ 1284-1285 (lines=2) @@
1281
	// Define the timezone for this event, falling back to the default if not provided
1282
	if (!empty($eventOptions['tz']) && in_array($eventOptions['tz'], timezone_identifiers_list(DateTimeZone::ALL_WITH_BC)))
1283
		$tz = $eventOptions['tz'];
1284
	elseif (!empty($_POST['tz']) && in_array($_POST['tz'], timezone_identifiers_list(DateTimeZone::ALL_WITH_BC)))
1285
		$tz = $_POST['tz'];
1286
	else
1287
		$tz = getUserTimezone();
1288
@@ 1547-1548 (lines=2) @@
1544
		$smcFunc['db_free_result']($request);
1545
	}
1546
1547
	if (empty($timezone) || !in_array($timezone, timezone_identifiers_list(DateTimeZone::ALL_WITH_BC)))
1548
		$timezone = isset($modSettings['default_timezone']) ? $modSettings['default_timezone'] : date_default_timezone_get();
1549
1550
	return $timezone;
1551
}