diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 22201c9db83a6..b12e11576ddc8 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -389,7 +389,7 @@ public function fopen($path, $mode) { 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 @@ protected function getFullPath($path) { */ 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 @@ protected function readFirstBlock($path) { 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 @@ protected function parseRawHeader($rawHeader) { */ 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; } diff --git a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php index d152a51ed858a..8e0b31aaa4335 100644 --- a/tests/lib/Files/Storage/Wrapper/EncryptionTest.php +++ b/tests/lib/Files/Storage/Wrapper/EncryptionTest.php @@ -613,7 +613,7 @@ public function testGetHeader($path, $strippedPathExists, $strippedPath) { $util->expects($this->once())->method('stripPartialFileExtension') ->with($path)->willReturn($strippedPath); $sourceStorage->expects($this->once()) - ->method('file_exists') + ->method('is_file') ->with($strippedPath) ->willReturn($strippedPathExists); @@ -641,7 +641,7 @@ public function testGetHeaderAddLegacyModule($header, $isEncrypted, $exists, $ex ->disableOriginalConstructor()->getMock(); $sourceStorage->expects($this->once()) - ->method('file_exists') + ->method('is_file') ->willReturn($exists); $util = $this->getMockBuilder('\OC\Encryption\Util')