diff options
author | acsfer <carlos@reendex.com> | 2021-06-09 15:38:21 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-10-23 12:28:25 +0300 |
commit | eea1c237197a1dcdf4ee0cf3de9c94b2683aba40 (patch) | |
tree | b4d6a238863823910d2208209ed9fe298e44f455 /lib | |
parent | a87643a9e031022878283e890bc1a7d5c36c12ab (diff) |
Handle files with is_file instead of file_exists
Should fix things like `fread(): read of 8192 bytes failed with errno=21 Is a directory`
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Encryption.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 125338a290d..ef5697cdd24 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -391,7 +391,7 @@ class Encryption extends Wrapper { if ($this->util->isExcluded($fullPath) === false) { $size = $unencryptedSize = 0; $realFile = $this->util->stripPartialFileExtension($path); - $targetExists = $this->file_exists($realFile) || $this->file_exists($path); + $targetExists = $this->is_file($realFile) || $this->file_exists($path); $targetIsEncrypted = false; if ($targetExists) { // in case the file exists we require the explicit module as @@ -855,7 +855,7 @@ class Encryption extends Wrapper { */ protected function readFirstBlock($path) { $firstBlock = ''; - if ($this->storage->file_exists($path)) { + if ($this->storage->is_file($path)) { $handle = $this->storage->fopen($path, 'r'); $firstBlock = fread($handle, $this->util->getHeaderSize()); fclose($handle); @@ -872,7 +872,7 @@ class Encryption extends Wrapper { protected function getHeaderSize($path) { $headerSize = 0; $realFile = $this->util->stripPartialFileExtension($path); - if ($this->storage->file_exists($realFile)) { + if ($this->storage->is_file($realFile)) { $path = $realFile; } $firstBlock = $this->readFirstBlock($path); @@ -920,7 +920,7 @@ class Encryption extends Wrapper { */ protected function getHeader($path) { $realFile = $this->util->stripPartialFileExtension($path); - $exists = $this->storage->file_exists($realFile); + $exists = $this->storage->is_file($realFile); if ($exists) { $path = $realFile; } |