summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-04-04 13:12:29 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-04-04 20:25:59 +0200
commit30c95b51fba347e4855e5873c6cde59fcca7f2c6 (patch)
tree5c83faeac6d249bb1935e4ac53ba841130e12ee9
parent52eaf6cfbbffdfa6f86f0b0cef544198877b4bde (diff)
downloadnextcloud-server-30c95b51fba347e4855e5873c6cde59fcca7f2c6.tar.gz
nextcloud-server-30c95b51fba347e4855e5873c6cde59fcca7f2c6.zip
fix fseek against string not resource by removing append support
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--apps/files_external/lib/Lib/Storage/Swift.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php
index 5fec278ef3d..105d1073ae6 100644
--- a/apps/files_external/lib/Lib/Storage/Swift.php
+++ b/apps/files_external/lib/Lib/Storage/Swift.php
@@ -373,6 +373,10 @@ class Swift extends \OC\Files\Storage\Common {
$path = $this->normalizePath($path);
switch ($mode) {
+ case 'a':
+ case 'ab':
+ case 'a+':
+ return false;
case 'r':
case 'rb':
try {
@@ -395,12 +399,9 @@ class Swift extends \OC\Files\Storage\Common {
}
case 'w':
case 'wb':
- case 'a':
- case 'ab':
case 'r+':
case 'w+':
case 'wb+':
- case 'a+':
case 'x':
case 'x+':
case 'c':
@@ -419,10 +420,6 @@ class Swift extends \OC\Files\Storage\Common {
}
$source = $this->fopen($path, 'r');
file_put_contents($tmpFile, $source);
- // Seek to end if required
- if ($mode[0] === 'a') {
- fseek($tmpFile, 0, SEEK_END);
- }
}
$handle = fopen($tmpFile, $mode);
return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {