summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorDaniel Tosello <tosello.daniel@gmail.com>2015-12-10 16:36:28 +1100
committerDaniel Tosello <tosello.daniel@gmail.com>2015-12-10 16:40:17 +1100
commit41f1feaf2304c8c2367168a7f3ac2793f0fb7eb2 (patch)
tree2608766f59e13c2a9b4b9d2a2cbbee32cc6e13d8 /apps
parentcb9a4d4cdcb0bf53121c39d2c918c16a027f69bd (diff)
downloadnextcloud-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.php5
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;