Code Duplication    Length = 2-2 lines in 3 locations

Sources/Calendar.php 1 location

@@ 117-118 (lines=2) @@
114
	// Make sure the year and month are in valid ranges.
115
	if ($curPage['month'] < 1 || $curPage['month'] > 12)
116
		fatal_lang_error('invalid_month', false);
117
	if ($curPage['year'] < $modSettings['cal_minyear'] || $curPage['year'] > $modSettings['cal_maxyear'])
118
		fatal_lang_error('invalid_year', false);
119
	// If we have a day clean that too.
120
	if ($context['view_week'])
121
	{

Sources/Subs-Calendar.php 1 location

@@ 727-728 (lines=2) @@
724
		// Check the month and year...
725
		if ($_POST['month'] < 1 || $_POST['month'] > 12)
726
			fatal_lang_error('invalid_month', false);
727
		if ($_POST['year'] < $modSettings['cal_minyear'] || $_POST['year'] > $modSettings['cal_maxyear'])
728
			fatal_lang_error('invalid_year', false);
729
	}
730
731
	// Make sure they're allowed to post...

Sources/Post.php 1 location

@@ 309-310 (lines=2) @@
306
			// Make sure the year and month are in the valid range.
307
			if ($context['event']['month'] < 1 || $context['event']['month'] > 12)
308
				fatal_lang_error('invalid_month', false);
309
			if ($context['event']['year'] < $modSettings['cal_minyear'] || $context['event']['year'] > $modSettings['cal_maxyear'])
310
				fatal_lang_error('invalid_year', false);
311
312
			// Get a list of boards they can post in.
313
			$boards = boardsAllowedTo('post_new');