From bf09bcc8542cae436a3d712032ae51725f3d929c Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Tue, 10 Jul 2012 11:54:41 +0200
Subject: [PATCH] add OCP\Files to access files

---
 apps/files_versions/lib/versions.php | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 4f0ee2c6d52..723c27577a7 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -239,10 +239,9 @@ class Storage {
 				$versions[$i]['version'] = ( end( $parts ) );
 				
 				// if file with modified date exists, flag it in array as currently enabled version
-				$curFile['fileName'] = basename( $parts[0] );
-				$curFile['filePath'] = \OCP\Config::getSystemValue('datadirectory').\OC_Filesystem::getRoot().'/'.$curFile['fileName'];
-				
-				( \md5_file( $ma ) == \md5_file( $curFile['filePath'] ) ? $versions[$i]['fileMatch'] = 1 : $versions[$i]['fileMatch'] = 0 );
+				$files_view = \OCP\Files::getStorage('files');
+				$local_file = $files_view->getLocalFile($filename);
+				( \md5_file( $ma ) == \md5_file( $local_file ) ? $versions[$i]['fileMatch'] = 1 : $versions[$i]['fileMatch'] = 0 );
 				
 			}
 			
-- 
GitLab