Code Duplication    Length = 14-15 lines in 2 locations

Sources/ManageNews.php 2 locations

@@ 767-780 (lines=14) @@
764
				$context['recipients']['members'][] = (int) $member;
765
	}
766
	// Cleaning groups is simple - although deal with both checkbox and commas.
767
	if (isset($_POST['groups']))
768
	{
769
		if (is_array($_POST['groups']))
770
		{
771
			foreach ($_POST['groups'] as $group => $dummy)
772
				$context['recipients']['groups'][] = (int) $group;
773
		}
774
		else
775
		{
776
			$groups = explode(',', $_POST['groups']);
777
			foreach ($groups as $group)
778
				$context['recipients']['groups'][] = (int) $group;
779
		}
780
	}
781
	// Same for excluded groups
782
	if (isset($_POST['exclude_groups']))
783
	{
@@ 782-796 (lines=15) @@
779
		}
780
	}
781
	// Same for excluded groups
782
	if (isset($_POST['exclude_groups']))
783
	{
784
		if (is_array($_POST['exclude_groups']))
785
		{
786
			foreach ($_POST['exclude_groups'] as $group => $dummy)
787
				$context['recipients']['exclude_groups'][] = (int) $group;
788
		}
789
		// Ignore an empty string - we don't want to exclude "Regular Members" unless it's specifically selected
790
		elseif ($_POST['exclude_groups'] != '')
791
		{
792
			$groups = explode(',', $_POST['exclude_groups']);
793
			foreach ($groups as $group)
794
				$context['recipients']['exclude_groups'][] = (int) $group;
795
		}
796
	}
797
	// Finally - emails!
798
	if (!empty($_POST['emails']))
799
	{