Don't use is_array on FileInfo
This commit is contained in:
parent
c01949ec0e
commit
ec7c339930
|
@ -117,7 +117,7 @@ class Proxy extends \OC_FileProxy {
|
||||||
// update file cache for target file
|
// update file cache for target file
|
||||||
$tmpFileInfo = $view->getFileInfo($tmpPath);
|
$tmpFileInfo = $view->getFileInfo($tmpPath);
|
||||||
$fileInfo = $view->getFileInfo($path);
|
$fileInfo = $view->getFileInfo($path);
|
||||||
if (is_array($fileInfo) && is_array($tmpFileInfo)) {
|
if ($fileInfo && $tmpFileInfo) {
|
||||||
$fileInfo['encrypted'] = true;
|
$fileInfo['encrypted'] = true;
|
||||||
$fileInfo['unencrypted_size'] = $tmpFileInfo['size'];
|
$fileInfo['unencrypted_size'] = $tmpFileInfo['size'];
|
||||||
$view->putFileInfo($path, $fileInfo);
|
$view->putFileInfo($path, $fileInfo);
|
||||||
|
@ -365,7 +365,7 @@ class Proxy extends \OC_FileProxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if file is encrypted return real file size
|
// if file is encrypted return real file size
|
||||||
if (is_array($fileInfo) && $fileInfo['encrypted'] === true) {
|
if ($fileInfo && $fileInfo['encrypted'] === true) {
|
||||||
// try to fix unencrypted file size if it doesn't look plausible
|
// try to fix unencrypted file size if it doesn't look plausible
|
||||||
if ((int)$fileInfo['size'] > 0 && (int)$fileInfo['unencrypted_size'] === 0 ) {
|
if ((int)$fileInfo['size'] > 0 && (int)$fileInfo['unencrypted_size'] === 0 ) {
|
||||||
$fixSize = $util->getFileSize($path);
|
$fixSize = $util->getFileSize($path);
|
||||||
|
|
|
@ -567,7 +567,7 @@ class Stream {
|
||||||
|
|
||||||
// get file info
|
// get file info
|
||||||
$fileInfo = $this->rootView->getFileInfo($path);
|
$fileInfo = $this->rootView->getFileInfo($path);
|
||||||
if (is_array($fileInfo)) {
|
if ($fileInfo) {
|
||||||
// set encryption data
|
// set encryption data
|
||||||
$fileInfo['encrypted'] = true;
|
$fileInfo['encrypted'] = true;
|
||||||
$fileInfo['size'] = $this->size;
|
$fileInfo['size'] = $this->size;
|
||||||
|
|
Loading…
Reference in New Issue