mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #54607 from nextcloud/fix/fix-type-error-in-encryption
This commit is contained in:
commit
111350b17b
2 changed files with 7 additions and 2 deletions
|
|
@ -683,6 +683,8 @@ class Encryption extends Wrapper {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$source = false;
|
||||
$target = false;
|
||||
try {
|
||||
$source = $sourceStorage->fopen($sourceInternalPath, 'r');
|
||||
$target = $this->fopen($targetInternalPath, 'w');
|
||||
|
|
@ -692,10 +694,10 @@ class Encryption extends Wrapper {
|
|||
[, $result] = Files::streamCopy($source, $target, true);
|
||||
}
|
||||
} finally {
|
||||
if (isset($source) && $source !== false) {
|
||||
if ($source !== false) {
|
||||
fclose($source);
|
||||
}
|
||||
if (isset($target) && $target !== false) {
|
||||
if ($target !== false) {
|
||||
fclose($target);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1205,6 +1205,9 @@ class ViewTest extends \Test\TestCase {
|
|||
$storage2->method('writeStream')
|
||||
->willThrowException(new GenericFileException('Failed to copy stream'));
|
||||
|
||||
$storage2->method('fopen')
|
||||
->willReturn(false);
|
||||
|
||||
$storage1->mkdir('sub');
|
||||
$storage1->file_put_contents('foo.txt', '0123456789ABCDEFGH');
|
||||
$storage1->mkdir('dirtomove');
|
||||
|
|
|
|||
Loading…
Reference in a new issue