diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-11-28 13:17:19 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-11-28 13:31:08 +0100 |
commit | eaedda2116ddde4b0a571ccdf96437eea37fe380 (patch) | |
tree | 84fab876b368dd5f947f22dcb6fb80083207a850 /apps/files_versions/lib/hooks.php | |
parent | a1d2f0f51605b6c4b2a204e6650c683881052a1a (diff) | |
download | nextcloud-server-eaedda2116ddde4b0a571ccdf96437eea37fe380.tar.gz nextcloud-server-eaedda2116ddde4b0a571ccdf96437eea37fe380.zip |
make sure that we don't try to access an already deleted files, fixes some file source not found warnings
Diffstat (limited to 'apps/files_versions/lib/hooks.php')
-rw-r--r-- | apps/files_versions/lib/hooks.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php index 81ee3c8b3c6..5d3882cc3e3 100644 --- a/apps/files_versions/lib/hooks.php +++ b/apps/files_versions/lib/hooks.php @@ -46,6 +46,17 @@ class Hooks { } /** + * @brief mark file as "deleted" so that we can clean up the versions if the file is gone + * @param array $params + */ + public static function pre_remove_hook($params) { + $path = $params[\OC\Files\Filesystem::signal_param_path]; + if($path<>'') { + Storage::markDeletedFile($path); + } + } + + /** * @brief rename/move versions of renamed/moved files * @param array with oldpath and newpath * @@ -53,7 +64,7 @@ class Hooks { * of the stored versions along the actual file */ public static function rename_hook($params) { - + if (\OCP\App::isEnabled('files_versions')) { $oldpath = $params['oldpath']; $newpath = $params['newpath']; @@ -71,7 +82,7 @@ class Hooks { * to remove the used space for versions stored in the database */ public static function deleteUser_hook($params) { - + if (\OCP\App::isEnabled('files_versions')) { $uid = $params['uid']; Storage::deleteUser($uid); |