Code Duplication    Length = 10-10 lines in 2 locations

mail/inc/class.mail_compose.inc.php 1 location

@@ 1891-1900 (lines=10) @@
1888
		//error_log(__METHOD__.__LINE__.' FileSize:'.filesize($attachment['tmp_name']));
1889
		if ($_GET['mode'] != "save")
1890
		{
1891
			if (strtoupper($attachment['type']) == 'TEXT/DIRECTORY')
1892
			{
1893
				$sfxMimeType = $attachment['type'];
1894
				$buff = explode('.',$attachment['tmp_name']);
1895
				$suffix = '';
1896
				if (is_array($buff)) $suffix = array_pop($buff); // take the last extension to check with ext2mime
1897
				if (!empty($suffix)) $sfxMimeType = Api\MimeMagic::ext2mime($suffix);
1898
				$attachment['type'] = $sfxMimeType;
1899
				if (strtoupper($sfxMimeType) == 'TEXT/VCARD' || strtoupper($sfxMimeType) == 'TEXT/X-VCARD') $attachment['type'] = strtoupper($sfxMimeType);
1900
			}
1901
			//error_log(__METHOD__.print_r($attachment,true));
1902
			if (strtoupper($attachment['type']) == 'TEXT/CALENDAR' || strtoupper($attachment['type']) == 'TEXT/X-VCALENDAR')
1903
			{

mail/inc/class.mail_ui.inc.php 1 location

@@ 2578-2587 (lines=10) @@
2575
		//error_log(__METHOD__.print_r($_GET,true));
2576
		if ($_GET['mode'] != "save")
2577
		{
2578
			if (strtoupper($attachment['type']) == 'TEXT/DIRECTORY' || empty($attachment['type']))
2579
			{
2580
				$sfxMimeType = $attachment['type'];
2581
				$buff = explode('.',$attachment['filename']);
2582
				$suffix = '';
2583
				if (is_array($buff)) $suffix = array_pop($buff); // take the last extension to check with ext2mime
2584
				if (!empty($suffix)) $sfxMimeType = Api\MimeMagic::ext2mime($suffix);
2585
				$attachment['type'] = $sfxMimeType;
2586
				if (strtoupper($sfxMimeType) == 'TEXT/VCARD' || strtoupper($sfxMimeType) == 'TEXT/X-VCARD') $attachment['type'] = strtoupper($sfxMimeType);
2587
			}
2588
			//error_log(__METHOD__.print_r($attachment,true));
2589
			if (strtoupper($attachment['type']) == 'TEXT/CALENDAR' || strtoupper($attachment['type']) == 'TEXT/X-VCALENDAR')
2590
			{