Code Duplication    Length = 2-2 lines in 3 locations

Sources/Calendar.php 1 location

@@ 179-180 (lines=2) @@
176
	// Make sure the year and month are in valid ranges.
177
	if ($curPage['month'] < 1 || $curPage['month'] > 12)
178
		fatal_lang_error('invalid_month', false);
179
	if ($curPage['year'] < $modSettings['cal_minyear'] || $curPage['year'] > $modSettings['cal_maxyear'])
180
		fatal_lang_error('invalid_year', false);
181
	// If we have a day clean that too.
182
	if ($context['calendar_view'] != 'view_month')
183
	{

Sources/Post.php 1 location

@@ 290-291 (lines=2) @@
287
			// Make sure the year and month are in the valid range.
288
			if ($context['event']['month'] < 1 || $context['event']['month'] > 12)
289
				fatal_lang_error('invalid_month', false);
290
			if ($context['event']['year'] < $modSettings['cal_minyear'] || $context['event']['year'] > $modSettings['cal_maxyear'])
291
				fatal_lang_error('invalid_year', false);
292
293
			// Get a list of boards they can post in.
294
			$boards = boardsAllowedTo('post_new');

Sources/Subs-Calendar.php 1 location

@@ 926-927 (lines=2) @@
923
			// Check the month and year...
924
			if ($_POST['month'] < 1 || $_POST['month'] > 12)
925
				fatal_lang_error('invalid_month', false);
926
			if ($_POST['year'] < $modSettings['cal_minyear'] || $_POST['year'] > $modSettings['cal_maxyear'])
927
				fatal_lang_error('invalid_year', false);
928
		}
929
	}
930