diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-04-24 16:12:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-24 16:12:12 +0200 |
commit | da8639a6cad73e59c3224d7c64400eac92fb1497 (patch) | |
tree | c7df0b7d4653ffd799b004baa1b958a7be89d27f | |
parent | c1653be56e5388545a8422ca7603d12d4588e540 (diff) | |
parent | ad5dcc2cd6cf1f6d924cc679be1a5b4330058ab1 (diff) | |
download | nextcloud-server-da8639a6cad73e59c3224d7c64400eac92fb1497.tar.gz nextcloud-server-da8639a6cad73e59c3224d7c64400eac92fb1497.zip |
Merge pull request #15205 from nextcloud/backport/15168/stable15
[stable15] Always use a temp file for swift writes
-rw-r--r-- | lib/private/Files/ObjectStore/Swift.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php index 7e4654b6eb2..fd416157635 100644 --- a/lib/private/Files/ObjectStore/Swift.php +++ b/lib/private/Files/ObjectStore/Swift.php @@ -76,14 +76,9 @@ class Swift implements IObjectStore { * @throws \Exception from openstack lib when something goes wrong */ public function writeObject($urn, $stream) { - $handle = $stream; - - $meta = stream_get_meta_data($stream); - if (!(isset($meta['seekable']) && $meta['seekable'] === true)) { - $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('swiftwrite'); - file_put_contents($tmpFile, $stream); - $handle = fopen($tmpFile, 'rb'); - } + $tmpFile = \OC::$server->getTempManager()->getTemporaryFile('swiftwrite'); + file_put_contents($tmpFile, $stream); + $handle = fopen($tmpFile, 'rb'); $this->getContainer()->createObject([ 'name' => $urn, |