Code Duplication    Length = 8-10 lines in 2 locations

apps/files_trashbin/ajax/undelete.php 1 location

@@ 72-79 (lines=8) @@
69
		$timestamp = null;
70
	}
71
72
	if ( !OCA\Files_Trashbin\Trashbin::restore($path, $filename, $timestamp) ) {
73
		$error[] = $filename;
74
		\OCP\Util::writeLog('trashbin', 'can\'t restore ' . $filename, \OCP\Util::ERROR);
75
	} else {
76
		$success[$i]['filename'] = $file;
77
		$success[$i]['timestamp'] = $timestamp;
78
		$i++;
79
	}
80
81
}
82

apps/files_trashbin/ajax/delete.php 1 location

@@ 67-76 (lines=10) @@
64
	}
65
66
	OCA\Files_Trashbin\Trashbin::delete($filename, \OCP\User::getUser(), $timestamp);
67
	if (OCA\Files_Trashbin\Trashbin::file_exists($filename, $timestamp)) {
68
		$error[] = $filename;
69
		\OCP\Util::writeLog('trashbin','can\'t delete ' . $filename . ' permanently.', \OCP\Util::ERROR);
70
	}
71
	// only list deleted files if not deleting everything
72
	else if (!$deleteAll) {
73
		$success[$i]['filename'] = $file;
74
		$success[$i]['timestamp'] = $timestamp;
75
		$i++;
76
	}
77
}
78
79
if ( $error ) {