fix encrypted flags not being saved correctly

This commit is contained in:
Robin Appelman 2012-06-20 20:18:26 +02:00
parent 9ba467d629
commit e43d02fadb
2 changed files with 3 additions and 3 deletions

View 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);
}

View 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),'/');
}
}
}