From: Robin Appelman Date: Wed, 20 Jun 2012 18:18:26 +0000 (+0200) Subject: fix encrypted flags not being saved correctly X-Git-Tag: v4.0.3~27 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e43d02fadb25c7cfce8e57f542e27b458c147a30;p=nextcloud-server.git fix encrypted flags not being saved correctly --- diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php index 56331cbf601..c59a520a8d6 100644 --- a/apps/files_encryption/lib/cryptstream.php +++ b/apps/files_encryption/lib/cryptstream.php @@ -159,7 +159,7 @@ class OC_CryptStream{ public function stream_close(){ $this->flush(); if($this->meta['mode']!='r' and $this->meta['mode']!='rb'){ - OC_FileCache::put($this->path,array('encrypted'=>true)); + OC_FileCache::put($this->path,array('encrypted'=>true),'/'); } return fclose($this->source); } diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 9fd57c0f02b..052fff0bbb5 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -59,7 +59,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ * @return bool */ private static function isEncrypted($path){ - $metadata=OC_FileCache::getCached($path,''); + $metadata=OC_FileCache::getCached($path,'/'); return isset($metadata['encrypted']) and (bool)$metadata['encrypted']; } @@ -67,7 +67,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{ if(self::shouldEncrypt($path)){ if (!is_resource($data)) {//stream put contents should have been converter to fopen $data=OC_Crypt::blockEncrypt($data); - OC_FileCache::put($path,array('encrypted'=>true)); + OC_FileCache::put($path,array('encrypted'=>true),'/'); } } }