diff options
author | Daniel Tosello <tosello.daniel@gmail.com> | 2015-12-10 16:36:28 +1100 |
---|---|---|
committer | Daniel Tosello <tosello.daniel@gmail.com> | 2015-12-10 16:40:17 +1100 |
commit | 41f1feaf2304c8c2367168a7f3ac2793f0fb7eb2 (patch) | |
tree | 2608766f59e13c2a9b4b9d2a2cbbee32cc6e13d8 /apps | |
parent | cb9a4d4cdcb0bf53121c39d2c918c16a027f69bd (diff) | |
download | nextcloud-server-41f1feaf2304c8c2367168a7f3ac2793f0fb7eb2.tar.gz nextcloud-server-41f1feaf2304c8c2367168a7f3ac2793f0fb7eb2.zip |
Fixing swift fopen by ensuring stream is a valid resource
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_external/lib/swift.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index 8311ad202ad..02bfc44c36d 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -323,7 +323,10 @@ class Swift extends \OC\Files\Storage\Common { $streamInterface->rewind(); $stream = $streamInterface->getStream(); stream_context_set_option($stream, 'swift','content', $streamInterface); - return $stream; + if(is_resource($stream)) { + return $stream; + } + return false; } catch (\Guzzle\Http\Exception\BadResponseException $e) { \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); return false; |