Code Duplication    Length = 7-8 lines in 2 locations

api/src/Mail.php 2 locations

@@ 1700-1707 (lines=8) @@
1697
					if (count($headerObject['TO'])>1)
1698
					{
1699
						$ki=0;
1700
						foreach($headerObject['TO'] as $k => $add)
1701
						{
1702
							if ($k==0) continue;
1703
							//error_log(__METHOD__.' ('.__LINE__.') '."-> $k:".array2string($add));
1704
							$retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki] = self::decode_header($add,true);
1705
							//error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]));
1706
							$ki++;
1707
						}
1708
					}
1709
				}
1710
				if(is_array($headerObject['CC']) && count($headerObject['CC'])>0) {
@@ 1712-1718 (lines=7) @@
1709
				}
1710
				if(is_array($headerObject['CC']) && count($headerObject['CC'])>0) {
1711
					$ki=0;
1712
					foreach($headerObject['CC'] as $k => $add)
1713
					{
1714
						//error_log(__METHOD__.' ('.__LINE__.') '."-> $k:".array2string($add));
1715
						$retValue['header'][$sortOrder[$uid]]['cc_addresses'][$ki] = self::decode_header($add,true);
1716
						//error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue['header'][$sortOrder[$uid]]['additional_to_addresses'][$ki]));
1717
						$ki++;
1718
					}
1719
				}
1720
				//error_log(__METHOD__.' ('.__LINE__.') '.array2string($retValue['header'][$sortOrder[$uid]]));
1721