Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 1861-1864 (lines=4) @@
1858
			Vfs::load_wrapper('vfs');
1859
		}
1860
		// attachment data in temp_dir, only use basename of given name, to not allow path traversal
1861
		else
1862
		{
1863
			$attachment['tmp_name'] = $GLOBALS['egw_info']['server']['temp_dir'].SEP.basename($attachment['tmp_name']);
1864
		}
1865
		if(!file_exists($attachment['tmp_name']))
1866
		{
1867
			header('HTTP/1.1 404 Not found');

api/src/Mail.php 1 location

@@ 6466-6469 (lines=4) @@
6463
			{
6464
				$tmpFileName = $_formData['file'];	// no need to store it somewhere
6465
			}
6466
			elseif (is_uploaded_file($_formData['file']))
6467
			{
6468
				move_uploaded_file($_formData['file'], $GLOBALS['egw_info']['server']['temp_dir'].'/'.$tmpFileName);	// requirement for safe_mode!
6469
			}
6470
			else
6471
			{
6472
				rename($_formData['file'], $GLOBALS['egw_info']['server']['temp_dir'].'/'.$tmpFileName);