Code Duplication    Length = 7-8 lines in 2 locations

api/src/Mail.php 2 locations

@@ 1710-1717 (lines=8) @@
1707
					if (count($headerObject['TO'])>1)
1708
					{
1709
						$ki=0;
1710
						foreach($headerObject['TO'] as $k => $add)
1711
						{
1712
							if ($k==0) continue;
1713
							//error_log(__METHOD__.' ('.__LINE__.') '."-> $k:".array2string($add));
1714
							$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki] = self::decode_header($add,true);
1715
							//error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]));
1716
							$ki++;
1717
						}
1718
					}
1719
				}
1720
				if(is_array($headerObject['CC']) && count($headerObject['CC'])>0) {
@@ 1722-1728 (lines=7) @@
1719
				}
1720
				if(is_array($headerObject['CC']) && count($headerObject['CC'])>0) {
1721
					$ki=0;
1722
					foreach($headerObject['CC'] as $k => $add)
1723
					{
1724
						//error_log(__METHOD__.' ('.__LINE__.') '."-> $k:".array2string($add));
1725
						$retValue['header'][$sortOrder[$uid]]['cc_addresses'][$ki] = self::decode_header($add,true);
1726
						//error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]));
1727
						$ki++;
1728
					}
1729
				}
1730
				//error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue['header'][$sortOrder[$uid]]));
1731