mirror of
https://github.com/nextcloud/server.git
synced 2026-03-14 22:53:43 -04:00
fix: Only read unencrypted_size when file is actually encrypted
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
19cf570aac
commit
8ddcebe3bd
2 changed files with 3 additions and 3 deletions
|
|
@ -134,7 +134,7 @@ class CacheEntry implements ICacheEntry {
|
|||
}
|
||||
|
||||
public function getUnencryptedSize(): int {
|
||||
if (isset($this->data['unencrypted_size']) && $this->data['unencrypted_size'] > 0) {
|
||||
if ($this->data['encrypted'] && isset($this->data['unencrypted_size']) && $this->data['unencrypted_size'] > 0) {
|
||||
return $this->data['unencrypted_size'];
|
||||
} else {
|
||||
return $this->data['size'] ?? 0;
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
|
|||
if ($includeMounts) {
|
||||
$this->updateEntryfromSubMounts();
|
||||
|
||||
if (isset($this->data['unencrypted_size']) && $this->data['unencrypted_size'] > 0) {
|
||||
if ($this->isEncrypted() && isset($this->data['unencrypted_size']) && $this->data['unencrypted_size'] > 0) {
|
||||
return $this->data['unencrypted_size'];
|
||||
} else {
|
||||
return isset($this->data['size']) ? 0 + $this->data['size'] : 0;
|
||||
|
|
@ -232,7 +232,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
|
|||
* @return bool
|
||||
*/
|
||||
public function isEncrypted() {
|
||||
return $this->data['encrypted'];
|
||||
return $this->data['encrypted'] ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue