Skip to content
Snippets Groups Projects
Commit 5c7e3cf2 authored by Björn Schießle's avatar Björn Schießle
Browse files

escape regular expressions; fix typo in variable name

parent f26c4774
No related branches found
No related tags found
No related merge requests found
......@@ -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)) ) {
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment