summaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-05-07 13:36:29 +0200
committerMorris Jobke <morris.jobke@gmail.com>2013-05-12 11:47:22 +0200
commitb9f426b1d70b1818aab9d54630b8d858a7e5a4dd (patch)
treecd81745b68ef48c6f7acacf6173754900b0f3793 /apps/files/lib
parent324c423548a708720a6f4247bb10be2f1314bd37 (diff)
downloadnextcloud-server-b9f426b1d70b1818aab9d54630b8d858a7e5a4dd.tar.gz
nextcloud-server-b9f426b1d70b1818aab9d54630b8d858a7e5a4dd.zip
[files] remove normalizePath on rename and dependency injection
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/files.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/files/lib/files.php b/apps/files/lib/files.php
index 02582eff20a..d5fdc8dde78 100644
--- a/apps/files/lib/files.php
+++ b/apps/files/lib/files.php
@@ -27,8 +27,9 @@ namespace OCA\Files;
class Files {
private $l10n;
- public function __construct() {
- $this->l10n = \OC_L10n::get('files');
+ public function __construct($view, $l10n) {
+ $this->view = $view;
+ $this->l10n = $l10n;
}
/**
@@ -56,10 +57,7 @@ class Files {
// rename of "/Shared" is denied
!($dir === '/' and $oldname === 'Shared') and
// THEN try to rename
- \OC\Files\Filesystem::rename(
- \OC\Files\Filesystem::normalizePath($dir . '/' . $oldname),
- \OC\Files\Filesystem::normalizePath($dir . '/' . $newname)
- )
+ $this->view->rename($dir . '/' . $oldname, $dir . '/' . $newname)
) {
// successful rename
$result['success'] = true;