summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/cryptstream.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-06-09 17:33:57 +0200
committerRobin Appelman <icewind@owncloud.com>2012-06-09 17:34:13 +0200
commit601bac746d62540425f7a9e13ffbbc61e12eaca2 (patch)
tree2a45f95ede3649d4f30a08e53656f077e784441a /apps/files_encryption/lib/cryptstream.php
parente7f6f7e452131320a73861ad975c3d7961074190 (diff)
downloadnextcloud-server-601bac746d62540425f7a9e13ffbbc61e12eaca2.tar.gz
nextcloud-server-601bac746d62540425f7a9e13ffbbc61e12eaca2.zip
use absolute path for file proxies
Diffstat (limited to 'apps/files_encryption/lib/cryptstream.php')
-rw-r--r--apps/files_encryption/lib/cryptstream.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php
index d6643f32689..a698ee00335 100644
--- a/apps/files_encryption/lib/cryptstream.php
+++ b/apps/files_encryption/lib/cryptstream.php
@@ -35,8 +35,12 @@ class OC_CryptStream{
private $meta=array();//header/meta for source stream
private $count;
private $writeCache;
+ private static $rootView;
public function stream_open($path, $mode, $options, &$opened_path){
+ if(!self::$rootView){
+ self::$rootView=new OC_FilesystemView('');
+ }
$path=str_replace('crypt://','',$path);
if(dirname($path)=='streams' and isset(self::$sourceStreams[basename($path)])){
$this->source=self::$sourceStreams[basename($path)]['stream'];
@@ -45,7 +49,7 @@ class OC_CryptStream{
$this->path=$path;
OCP\Util::writeLog('files_encryption','open encrypted '.$path. ' in '.$mode,OCP\Util::DEBUG);
OC_FileProxy::$enabled=false;//disable fileproxies so we can open the source file
- $this->source=OC_FileSystem::fopen($path,$mode);
+ $this->source=self::$rootView->fopen($path,$mode);
OC_FileProxy::$enabled=true;
if(!is_resource($this->source)){
OCP\Util::writeLog('files_encryption','failed to open '.$path,OCP\Util::ERROR);