Code Duplication    Length = 8-8 lines in 2 locations

apps/files/ajax/newfile.php 1 location

@@ 86-93 (lines=8) @@
83
//TODO why is stripslashes used on foldername in newfolder.php but not here?
84
$target = $dir.'/'.$filename;
85
86
if (\OC\Files\Filesystem::file_exists($target)) {
87
	$result['data'] = array('message' => (string)$l10n->t(
88
			'The name %s is already used in the folder %s. Please choose a different name.',
89
			array($filename, $dir))
90
		);
91
	OCP\JSON::error($result);
92
	exit();
93
}
94
95
if($source) {
96
	$httpHelper = \OC::$server->getHTTPHelper();

apps/files/ajax/newfolder.php 1 location

@@ 45-52 (lines=8) @@
42
//TODO why is stripslashes used on foldername here but not in newfile.php?
43
$target = $dir . '/' . stripslashes($foldername);
44
		
45
if (\OC\Files\Filesystem::file_exists($target)) {
46
	$result['data'] = array('message' => $l10n->t(
47
			'The name %s is already used in the folder %s. Please choose a different name.',
48
			array($foldername, $dir))
49
		);
50
	OCP\JSON::error($result);
51
	exit();
52
}
53
54
if(\OC\Files\Filesystem::mkdir($target)) {
55
	if ( $dir !== '/') {