diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-12-19 09:38:22 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-12-19 09:38:22 +0100 |
commit | 4ff11e395519987af95ffc62d7a8f0094b6978ff (patch) | |
tree | 4e895d54bf8481cf3e377ed5b5475b47cf8f5ffc /lib | |
parent | 8cd86f110bfa96fbf05a5792badc4821ec6035d9 (diff) | |
download | nextcloud-server-4ff11e395519987af95ffc62d7a8f0094b6978ff.tar.gz nextcloud-server-4ff11e395519987af95ffc62d7a8f0094b6978ff.zip |
Do not generate tokens for editor IDs that do not exist
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/DirectEditing/Manager.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/DirectEditing/Manager.php b/lib/private/DirectEditing/Manager.php index a739402d629..a514eaea482 100644 --- a/lib/private/DirectEditing/Manager.php +++ b/lib/private/DirectEditing/Manager.php @@ -45,6 +45,8 @@ use OCP\IUserSession; use OCP\L10N\IFactory; use OCP\Security\ISecureRandom; use OCP\Share\IShare; +use function array_key_exists; +use function in_array; class Manager implements IManager { @@ -140,6 +142,9 @@ class Manager implements IManager { if ($editorId === null) { $editorId = $this->findEditorForFile($file); } + if (!array_key_exists($editorId, $this->editors)) { + throw new \RuntimeException("Editor $editorId is unknown"); + } return $this->createToken($editorId, $file, $filePath); } |