From 41f1feaf2304c8c2367168a7f3ac2793f0fb7eb2 Mon Sep 17 00:00:00 2001 From: Daniel Tosello Date: Thu, 10 Dec 2015 16:36:28 +1100 Subject: [PATCH] Fixing swift fopen by ensuring stream is a valid resource --- apps/files_external/lib/swift.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index 8311ad202a..02bfc44c36 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;