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

@@ 6527-6530 (lines=4) @@
6524
			{
6525
				$tmpFileName = $_formData['file'];	// no need to store it somewhere
6526
			}
6527
			elseif (is_uploaded_file($_formData['file']))
6528
			{
6529
				move_uploaded_file($_formData['file'], $GLOBALS['egw_info']['server']['temp_dir'].'/'.$tmpFileName);	// requirement for safe_mode!
6530
			}
6531
			else
6532
			{
6533
				rename($_formData['file'], $GLOBALS['egw_info']['server']['temp_dir'].'/'.$tmpFileName);