diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-01-28 20:04:10 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-01-28 20:04:10 +0100 |
commit | 929b8c3e6926dbe4cf2c3e0b2eb00b502d49f64a (patch) | |
tree | 0a880b02a414fda1e84308a771e3b315411b7a12 /apps/files_versions/lib/hooks.php | |
parent | 7207211f3a9546f9d33cfffec0caf26ea419c50e (diff) | |
download | nextcloud-server-929b8c3e6926dbe4cf2c3e0b2eb00b502d49f64a.tar.gz nextcloud-server-929b8c3e6926dbe4cf2c3e0b2eb00b502d49f64a.zip |
fix files_version hooks
Diffstat (limited to 'apps/files_versions/lib/hooks.php')
-rw-r--r-- | apps/files_versions/lib/hooks.php | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php index 3a64e571d5a..5cefc532895 100644 --- a/apps/files_versions/lib/hooks.php +++ b/apps/files_versions/lib/hooks.php @@ -39,15 +39,15 @@ class Hooks { * cleanup the versions directory if the actual file gets deleted */ public static function remove_hook($params) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-
- $versions = new Storage( new \OC_FilesystemView('') );
-
- $path = $params[\OC_Filesystem::signal_param_path];
-
- if($path<>'') $versions->delete( $path );
-
- }
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + + $versions = new Storage( new \OC_FilesystemView('') ); + + $path = $params[\OC\Files\Filesystem::signal_param_path]; + + if($path<>'') $versions->delete( $path ); + + } } /** @@ -58,15 +58,15 @@ class Hooks { * of the stored versions along the actual file */ public static function rename_hook($params) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-
- $versions = new Storage( new \OC_FilesystemView('') );
-
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + + $versions = new Storage( new \OC_FilesystemView('') ); + $oldpath = $params['oldpath']; - $newpath = $params['newpath'];
-
- if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath );
-
+ $newpath = $params['newpath']; + + if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath ); + } } |