]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix encrypted flags not being saved correctly
authorRobin Appelman <icewind@owncloud.com>
Wed, 20 Jun 2012 18:18:26 +0000 (20:18 +0200)
committerRobin Appelman <icewind@owncloud.com>
Wed, 20 Jun 2012 18:18:42 +0000 (20:18 +0200)
apps/files_encryption/lib/cryptstream.php
apps/files_encryption/lib/proxy.php

index 56331cbf60135c23927f96ab4c4b8eff5c0edf89..c59a520a8d6f3a04bb22d46ff897b019852b0d30 100644 (file)
@@ -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);
        }
index 9fd57c0f02bd6d8e6ee65082b6f28008476d1eef..052fff0bbb5bcf8295507318bbee793d489707de 100644 (file)
@@ -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),'/');
                        }
                }
        }