Don't return file handle if the mode supports writing and the file is not writable
Conflicts: apps/files_sharing/sharedstorage.php
This commit is contained in:
parent
360c22fd28
commit
ffb55d5a17
1 changed files with 19 additions and 0 deletions
|
@ -416,6 +416,25 @@ class OC_Filestorage_Shared extends OC_Filestorage {
|
|||
public function fopen($path, $mode) {
|
||||
$source = $this->getSource($path);
|
||||
if ($source) {
|
||||
switch ($mode) {
|
||||
case 'r+':
|
||||
case 'rb+':
|
||||
case 'w+':
|
||||
case 'wb+':
|
||||
case 'x+':
|
||||
case 'xb+':
|
||||
case 'a+':
|
||||
case 'ab+':
|
||||
case 'w':
|
||||
case 'wb':
|
||||
case 'x':
|
||||
case 'xb':
|
||||
case 'a':
|
||||
case 'ab':
|
||||
if (!$this->is_writable($path)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$storage = OC_Filesystem::getStorage($source);
|
||||
return $storage->fopen($this->getInternalPath($source), $mode);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue