]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix fseek against string not resource by removing append support 4204/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Tue, 4 Apr 2017 11:12:29 +0000 (13:12 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Tue, 4 Apr 2017 18:25:59 +0000 (20:25 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
apps/files_external/lib/Lib/Storage/Swift.php

index 5fec278ef3de085fd0f4baeb90018741be73b9a8..105d1073ae6624e9a8b850ba53b271e4968af07a 100644 (file)
@@ -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) {