Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoracsfer <carlos@reendex.com>2021-06-09 15:38:21 +0300
committerMichaIng <micha@dietpi.com>2021-10-30 01:20:42 +0300
commit023c0603050aef4d2ecdf895767786d78c49453c (patch)
treebb15ced2701d06888ab18cccbc25f7d1e1959bdf /lib
parente48efef3516355c5d8e76c185ad4c8b0a6f3c0eb (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.php8
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 22201c9db83..b12e11576dd 100644
--- a/lib/private/Files/Storage/Wrapper/Encryption.php
+++ b/lib/private/Files/Storage/Wrapper/Encryption.php
@@ -389,7 +389,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
@@ -853,7 +853,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);
@@ -870,7 +870,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);
@@ -918,7 +918,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;
}