Преглед изворни кода

only wrap source if fopen was successful

tags/v9.0beta1
Bjoern Schiessle пре 8 година
родитељ
комит
c7883b1769
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4
    1
      lib/private/files/storage/wrapper/encryption.php

+ 4
- 1
lib/private/files/storage/wrapper/encryption.php Прегледај датотеку

@@ -320,7 +320,7 @@ class Encryption extends Wrapper {
*
* @param string $path
* @param string $mode
* @return resource
* @return resource|bool
* @throws GenericEncryptionException
* @throws ModuleDoesNotExistsException
*/
@@ -404,6 +404,9 @@ class Encryption extends Wrapper {
if ($shouldEncrypt === true && $encryptionModule !== null) {
$headerSize = $this->getHeaderSize($path);
$source = $this->storage->fopen($path, $mode);
if (!is_resource($source)) {
return false;
}
$handle = \OC\Files\Stream\Encryption::wrap($source, $path, $fullPath, $header,
$this->uid, $encryptionModule, $this->storage, $this, $this->util, $this->fileHelper, $mode,
$size, $unencryptedSize, $headerSize);

Loading…
Откажи
Сачувај