diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-02-27 10:51:32 +0100 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-02-27 10:51:32 +0100 |
commit | 5c7e3cf2e268e543eb2358d2c4276c2f9df95965 (patch) | |
tree | ee2b34cd9532e1b3a08ae6d33f98dec0a2e13650 | |
parent | f26c47743329679a9f2ade0b3fe778439050c5af (diff) | |
download | nextcloud-server-5c7e3cf2e268e543eb2358d2c4276c2f9df95965.tar.gz nextcloud-server-5c7e3cf2e268e543eb2358d2c4276c2f9df95965.zip |
escape regular expressions; fix typo in variable name
-rw-r--r-- | apps/files_versions/ajax/getVersions.php | 1 | ||||
-rw-r--r-- | apps/files_versions/lib/versions.php | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php index 8a8fa43080c..f9174c45a65 100644 --- a/apps/files_versions/ajax/getVersions.php +++ b/apps/files_versions/ajax/getVersions.php @@ -3,7 +3,6 @@ OCP\JSON::checkAppEnabled('files_versions'); $source = $_GET['source']; list ($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($source); - $count = 5; //show the newest revisions if( ($versions = OCA\Files_Versions\Storage::getVersions($uid, $filename, $count)) ) { diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 778fefd8a72..12f8fdaa0dc 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -107,7 +107,7 @@ class Storage { // store a new version of a file $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename)); $versionsSize = self::getVersionsSize($uid); - if ( $versionsSize === false || $versionSize < 0 ) { + if ( $versionsSize === false || $versionsSize < 0 ) { $versionsSize = self::calculateSize($uid); } @@ -208,10 +208,10 @@ class Storage { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { $versions_fileview = new \OC\Files\View('/' . $uid . '/files_versions'); - $versionsName = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename); + $versionsName = \OC_Filesystem::normalizePath(\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename)); $versions = array(); // fetch for old versions - $matches = glob( $versionsName.'.v*' ); + $matches = glob(preg_quote($versionsName).'.v*' ); if ( !$matches ) { return $versions; |