From ec7c339930618726f2f87899546ab7bc80ca96d5 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 17 Jan 2014 12:56:17 +0100 Subject: [PATCH] Don't use is_array on FileInfo --- apps/files_encryption/lib/proxy.php | 4 ++-- apps/files_encryption/lib/stream.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 41f352d853..70077e5e1f 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -117,7 +117,7 @@ class Proxy extends \OC_FileProxy { // update file cache for target file $tmpFileInfo = $view->getFileInfo($tmpPath); $fileInfo = $view->getFileInfo($path); - if (is_array($fileInfo) && is_array($tmpFileInfo)) { + if ($fileInfo && $tmpFileInfo) { $fileInfo['encrypted'] = true; $fileInfo['unencrypted_size'] = $tmpFileInfo['size']; $view->putFileInfo($path, $fileInfo); @@ -365,7 +365,7 @@ class Proxy extends \OC_FileProxy { } // 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 if ((int)$fileInfo['size'] > 0 && (int)$fileInfo['unencrypted_size'] === 0 ) { $fixSize = $util->getFileSize($path); diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php index b3bf34ddb8..88eacc6f13 100644 --- a/apps/files_encryption/lib/stream.php +++ b/apps/files_encryption/lib/stream.php @@ -567,7 +567,7 @@ class Stream { // get file info $fileInfo = $this->rootView->getFileInfo($path); - if (is_array($fileInfo)) { + if ($fileInfo) { // set encryption data $fileInfo['encrypted'] = true; $fileInfo['size'] = $this->size;