Code Duplication    Length = 5-5 lines in 3 locations

Sources/Load.php 1 location

@@ 236-240 (lines=5) @@
233
			$modSettings['default_timezone'] = '';
234
235
		// If date.timezone is unset, invalid, or just plain weird, make a best guess
236
		if (!in_array($modSettings['default_timezone'], timezone_identifiers_list()))
237
		{	
238
			$server_offset = @mktime(0, 0, 0, 1, 1, 1970);
239
			$modSettings['default_timezone'] = timezone_name_from_abbr('', $server_offset, 0);
240
		}
241
242
		date_default_timezone_set($modSettings['default_timezone']);
243
	}

other/install.php 2 locations

@@ 246-250 (lines=5) @@
243
			$timezone_id = '';
244
245
		// If date.timezone is unset, invalid, or just plain weird, make a best guess
246
		if (!in_array($timezone_id, timezone_identifiers_list()))
247
		{
248
			$server_offset = @mktime(0, 0, 0, 1, 1, 1970);
249
			$timezone_id = timezone_name_from_abbr('', $server_offset, 0);
250
		}
251
252
		date_default_timezone_set($timezone_id);
253
	}
@@ 1279-1283 (lines=5) @@
1276
			$timezone_id = '';
1277
1278
		// If date.timezone is unset, invalid, or just plain weird, make a best guess
1279
		if (!in_array($timezone_id, timezone_identifiers_list()))
1280
		{
1281
			$server_offset = @mktime(0, 0, 0, 1, 1, 1970);
1282
			$timezone_id = timezone_name_from_abbr('', $server_offset, 0);
1283
		}
1284
1285
		if (date_default_timezone_set($timezone_id))
1286
			$newSettings[] = array('default_timezone', $timezone_id);