Skip to content

Commit 1cb613b

Browse files
authored
Merge pull request #29417 from nextcloud/backport/27440/stable20
2 parents b06e32a + 8925839 commit 1cb613b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/private/Files/Storage/Wrapper/Encryption.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public function fopen($path, $mode) {
389389
if ($this->util->isExcluded($fullPath) === false) {
390390
$size = $unencryptedSize = 0;
391391
$realFile = $this->util->stripPartialFileExtension($path);
392-
$targetExists = $this->file_exists($realFile) || $this->file_exists($path);
392+
$targetExists = $this->is_file($realFile) || $this->file_exists($path);
393393
$targetIsEncrypted = false;
394394
if ($targetExists) {
395395
// in case the file exists we require the explicit module as
@@ -853,7 +853,7 @@ protected function getFullPath($path) {
853853
*/
854854
protected function readFirstBlock($path) {
855855
$firstBlock = '';
856-
if ($this->storage->file_exists($path)) {
856+
if ($this->storage->is_file($path)) {
857857
$handle = $this->storage->fopen($path, 'r');
858858
$firstBlock = fread($handle, $this->util->getHeaderSize());
859859
fclose($handle);
@@ -870,7 +870,7 @@ protected function readFirstBlock($path) {
870870
protected function getHeaderSize($path) {
871871
$headerSize = 0;
872872
$realFile = $this->util->stripPartialFileExtension($path);
873-
if ($this->storage->file_exists($realFile)) {
873+
if ($this->storage->is_file($realFile)) {
874874
$path = $realFile;
875875
}
876876
$firstBlock = $this->readFirstBlock($path);
@@ -918,7 +918,7 @@ protected function parseRawHeader($rawHeader) {
918918
*/
919919
protected function getHeader($path) {
920920
$realFile = $this->util->stripPartialFileExtension($path);
921-
$exists = $this->storage->file_exists($realFile);
921+
$exists = $this->storage->is_file($realFile);
922922
if ($exists) {
923923
$path = $realFile;
924924
}

tests/lib/Files/Storage/Wrapper/EncryptionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ public function testGetHeader($path, $strippedPathExists, $strippedPath) {
613613
$util->expects($this->once())->method('stripPartialFileExtension')
614614
->with($path)->willReturn($strippedPath);
615615
$sourceStorage->expects($this->once())
616-
->method('file_exists')
616+
->method('is_file')
617617
->with($strippedPath)
618618
->willReturn($strippedPathExists);
619619

@@ -641,7 +641,7 @@ public function testGetHeaderAddLegacyModule($header, $isEncrypted, $exists, $ex
641641
->disableOriginalConstructor()->getMock();
642642

643643
$sourceStorage->expects($this->once())
644-
->method('file_exists')
644+
->method('is_file')
645645
->willReturn($exists);
646646

647647
$util = $this->getMockBuilder('\OC\Encryption\Util')

0 commit comments

Comments
 (0)