diff options
author | Joas Schilling <coding@schilljs.com> | 2017-05-10 14:05:14 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-08-01 13:56:12 +0200 |
commit | 1e2de86c3ada8599cf6999abc1b1223d2d886430 (patch) | |
tree | 61459058793912b0bb5638e320f3e69b9341998a /apps/files_versions | |
parent | 89238164e12ba8532cdefed16a789cbd4e4efde5 (diff) | |
download | nextcloud-server-1e2de86c3ada8599cf6999abc1b1223d2d886430.tar.gz nextcloud-server-1e2de86c3ada8599cf6999abc1b1223d2d886430.zip |
Fix comparisons in the versions app
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_versions')
-rw-r--r-- | apps/files_versions/lib/Hooks.php | 10 | ||||
-rw-r--r-- | apps/files_versions/lib/Storage.php | 14 |
2 files changed, 12 insertions, 12 deletions
diff --git a/apps/files_versions/lib/Hooks.php b/apps/files_versions/lib/Hooks.php index 3753d8b5016..a9ebb153eff 100644 --- a/apps/files_versions/lib/Hooks.php +++ b/apps/files_versions/lib/Hooks.php @@ -57,7 +57,7 @@ class Hooks { if (\OCP\App::isEnabled('files_versions')) { $path = $params[\OC\Files\Filesystem::signal_param_path]; - if($path<>'') { + if($path !== '') { Storage::store($path); } } @@ -75,7 +75,7 @@ class Hooks { if (\OCP\App::isEnabled('files_versions')) { $path = $params[\OC\Files\Filesystem::signal_param_path]; - if($path<>'') { + if($path !== '') { Storage::delete($path); } } @@ -87,7 +87,7 @@ class Hooks { */ public static function pre_remove_hook($params) { $path = $params[\OC\Files\Filesystem::signal_param_path]; - if($path<>'') { + if($path !== '') { Storage::markDeletedFile($path); } } @@ -104,7 +104,7 @@ class Hooks { if (\OCP\App::isEnabled('files_versions')) { $oldpath = $params['oldpath']; $newpath = $params['newpath']; - if($oldpath<>'' && $newpath<>'') { + if($oldpath !== '' && $newpath !== '') { Storage::renameOrCopy($oldpath, $newpath, 'rename'); } } @@ -122,7 +122,7 @@ class Hooks { if (\OCP\App::isEnabled('files_versions')) { $oldpath = $params['oldpath']; $newpath = $params['newpath']; - if($oldpath<>'' && $newpath<>'') { + if($oldpath !== '' && $newpath !== '') { Storage::renameOrCopy($oldpath, $newpath, 'copy'); } } diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 6e6b6aebb6d..ff73b81f574 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -102,7 +102,7 @@ class Storage { $uid = User::getUser(); } Filesystem::initMountPoints($uid); - if ( $uid != User::getUser() ) { + if ( $uid !== User::getUser() ) { $info = Filesystem::getFileInfo($filename); $ownerView = new View('/'.$uid.'/files'); try { @@ -161,7 +161,7 @@ class Storage { * store a new version of a file. */ public static function store($filename) { - if(\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + if(\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED) === 'true') { // if the file gets streamed we need to remove the .part extension // to get the right target @@ -320,7 +320,7 @@ class Storage { */ public static function rollback($file, $revision) { - if(\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + if(\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED) === 'true') { // add expected leading slash $file = '/' . ltrim($file, '/'); list($uid, $filename) = self::getUidAndFilename($file); @@ -629,7 +629,7 @@ class Storage { $interval = 1; $step = Storage::$max_versions_per_interval[$interval]['step']; - if (Storage::$max_versions_per_interval[$interval]['intervalEndsAfter'] == -1) { + if (Storage::$max_versions_per_interval[$interval]['intervalEndsAfter'] === -1) { $nextInterval = -1; } else { $nextInterval = $time - Storage::$max_versions_per_interval[$interval]['intervalEndsAfter']; @@ -644,7 +644,7 @@ class Storage { foreach ($versions as $key => $version) { $newInterval = true; while ($newInterval) { - if ($nextInterval == -1 || $prevTimestamp > $nextInterval) { + if ($nextInterval === -1 || $prevTimestamp > $nextInterval) { if ($version['version'] > $nextVersion) { //distance between two version too small, mark to delete $toDelete[$key] = $version['path'] . '.v' . $version['version']; @@ -659,7 +659,7 @@ class Storage { $interval++; $step = Storage::$max_versions_per_interval[$interval]['step']; $nextVersion = $prevTimestamp - $step; - if (Storage::$max_versions_per_interval[$interval]['intervalEndsAfter'] == -1) { + if (Storage::$max_versions_per_interval[$interval]['intervalEndsAfter'] === -1) { $nextInterval = -1; } else { $nextInterval = $time - Storage::$max_versions_per_interval[$interval]['intervalEndsAfter']; @@ -701,7 +701,7 @@ class Storage { $config = \OC::$server->getConfig(); $expiration = self::getExpiration(); - if($config->getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' && $expiration->isEnabled()) { + if($config->getSystemValue('files_versions', Storage::DEFAULTENABLED) === 'true' && $expiration->isEnabled()) { // get available disk space for user $user = \OC::$server->getUserManager()->get($uid); if (is_null($user)) { |