summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/versions.php
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-31 21:10:03 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-31 21:10:03 +0200
commit57a56299d8a216cad170e0510167d0d7777f1f8a (patch)
treea00a2c287f0a6eaaf1cdf9cf22c1010192df04b0 /apps/files_versions/versions.php
parentd4ea853fcf3b3f82e2e489c81280b27bfbd62bf3 (diff)
downloadnextcloud-server-57a56299d8a216cad170e0510167d0d7777f1f8a.tar.gz
nextcloud-server-57a56299d8a216cad170e0510167d0d7777f1f8a.zip
more fixes
i donĀ“t understand why this worked before.
Diffstat (limited to 'apps/files_versions/versions.php')
-rw-r--r--apps/files_versions/versions.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/files_versions/versions.php b/apps/files_versions/versions.php
index 8a88808f548..ed4fd97e518 100644
--- a/apps/files_versions/versions.php
+++ b/apps/files_versions/versions.php
@@ -96,14 +96,14 @@ class Storage {
}
// check filesize
- if(filesize($filesfoldername.$filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)){
+ if(filesize($filesfoldername.'/'.$filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)){
return false;
}
// check mininterval if the file is being modified by the owner (all shared files should be versioned despite mininterval)
if ($uid == \OCP\User::getUser()) {
- $matches=glob($versionsfoldername.$filename.'.v*');
+ $matches=glob($versionsfoldername.'/'.$filename.'.v*');
sort($matches);
$parts=explode('.v',end($matches));
if((end($parts)+Storage::DEFAULTMININTERVAL)>time()){
@@ -114,10 +114,10 @@ class Storage {
// create all parent folders
$info=pathinfo($filename);
- @mkdir($versionsfoldername.$info['dirname'],0700,true);
+ if(!file_exists($versionsfoldername.'/'.$info['dirname'])) mkdir($versionsfoldername.'/'.$info['dirname'],0700,true);
// store a new version of a file
- copy($filesfoldername.$filename,$versionsfoldername.$filename.'.v'.time());
+ copy($filesfoldername.'/'.$filename,$versionsfoldername.'/'.$filename.'.v'.time());
// expire old revisions
Storage::expire($filename);
@@ -143,7 +143,7 @@ class Storage {
$filesfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. $uid .'/files';
// rollback
- if ( @copy($versionsfoldername.$filename.'.v'.$revision,$filesfoldername.$filename) ) {
+ if ( @copy($versionsfoldername.'/'.$filename.'.v'.$revision,$filesfoldername.$filename) ) {
return true;
@@ -172,7 +172,7 @@ class Storage {
$versionsfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. $uid .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
// check for old versions
- $matches=glob($versionsfoldername.$filename.'.v*');
+ $matches=glob($versionsfoldername.'/'.$filename.'.v*');
if(count($matches)>1){
return true;
}else{
@@ -201,7 +201,7 @@ class Storage {
$versions=array();
// fetch for old versions
- $matches=glob($versionsfoldername.$filename.'.v*');
+ $matches=glob($versionsfoldername.'/'.$filename.'.v*');
sort($matches);
foreach($matches as $ma) {
$parts=explode('.v',$ma);
@@ -238,14 +238,14 @@ class Storage {
$versionsfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. $uid .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
// check for old versions
- $matches=glob($versionsfoldername.$filename.'.v*');
+ $matches=glob($versionsfoldername.'/'.$filename.'.v*');
if(count($matches)>\OCP\Config::getSystemValue('files_versionmaxversions', Storage::DEFAULTMAXVERSIONS)){
$numbertodelete=count($matches-\OCP\Config::getSystemValue('files_versionmaxversions', Storage::DEFAULTMAXVERSIONS));
// delete old versions of a file
$deleteitems=array_slice($matches,0,$numbertodelete);
foreach($deleteitems as $de){
- unlink($versionsfoldername.$filename.'.v'.$de);
+ unlink($versionsfoldername.'/'.$filename.'.v'.$de);
}
}
}