fix fseek against string not resource by removing append support
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
52eaf6cfbb
commit
30c95b51fb
|
@ -373,6 +373,10 @@ class Swift extends \OC\Files\Storage\Common {
|
||||||
$path = $this->normalizePath($path);
|
$path = $this->normalizePath($path);
|
||||||
|
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
|
case 'a':
|
||||||
|
case 'ab':
|
||||||
|
case 'a+':
|
||||||
|
return false;
|
||||||
case 'r':
|
case 'r':
|
||||||
case 'rb':
|
case 'rb':
|
||||||
try {
|
try {
|
||||||
|
@ -395,12 +399,9 @@ class Swift extends \OC\Files\Storage\Common {
|
||||||
}
|
}
|
||||||
case 'w':
|
case 'w':
|
||||||
case 'wb':
|
case 'wb':
|
||||||
case 'a':
|
|
||||||
case 'ab':
|
|
||||||
case 'r+':
|
case 'r+':
|
||||||
case 'w+':
|
case 'w+':
|
||||||
case 'wb+':
|
case 'wb+':
|
||||||
case 'a+':
|
|
||||||
case 'x':
|
case 'x':
|
||||||
case 'x+':
|
case 'x+':
|
||||||
case 'c':
|
case 'c':
|
||||||
|
@ -419,10 +420,6 @@ class Swift extends \OC\Files\Storage\Common {
|
||||||
}
|
}
|
||||||
$source = $this->fopen($path, 'r');
|
$source = $this->fopen($path, 'r');
|
||||||
file_put_contents($tmpFile, $source);
|
file_put_contents($tmpFile, $source);
|
||||||
// Seek to end if required
|
|
||||||
if ($mode[0] === 'a') {
|
|
||||||
fseek($tmpFile, 0, SEEK_END);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$handle = fopen($tmpFile, $mode);
|
$handle = fopen($tmpFile, $mode);
|
||||||
return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
|
return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) {
|
||||||
|
|
Loading…
Reference in New Issue