fix encrypted flags not being saved correctly
This commit is contained in:
parent
9ba467d629
commit
e43d02fadb
|
@ -159,7 +159,7 @@ class OC_CryptStream{
|
||||||
public function stream_close(){
|
public function stream_close(){
|
||||||
$this->flush();
|
$this->flush();
|
||||||
if($this->meta['mode']!='r' and $this->meta['mode']!='rb'){
|
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);
|
return fclose($this->source);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private static function isEncrypted($path){
|
private static function isEncrypted($path){
|
||||||
$metadata=OC_FileCache::getCached($path,'');
|
$metadata=OC_FileCache::getCached($path,'/');
|
||||||
return isset($metadata['encrypted']) and (bool)$metadata['encrypted'];
|
return isset($metadata['encrypted']) and (bool)$metadata['encrypted'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
|
||||||
if(self::shouldEncrypt($path)){
|
if(self::shouldEncrypt($path)){
|
||||||
if (!is_resource($data)) {//stream put contents should have been converter to fopen
|
if (!is_resource($data)) {//stream put contents should have been converter to fopen
|
||||||
$data=OC_Crypt::blockEncrypt($data);
|
$data=OC_Crypt::blockEncrypt($data);
|
||||||
OC_FileCache::put($path,array('encrypted'=>true));
|
OC_FileCache::put($path,array('encrypted'=>true),'/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue