summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-12-22 14:27:28 +0100
committerGitHub <noreply@github.com>2019-12-22 14:27:28 +0100
commit04031f606a5ac673cdb1cdb7d76fde99fd748e81 (patch)
tree38668780726fdebba83282cad648a1de751dfd01 /lib/private
parent3af63f1593b94c811fbefea6ccfba379c71ef957 (diff)
parent0ddb9c01362a74662a4f062683c82c1594c7da01 (diff)
downloadnextcloud-server-04031f606a5ac673cdb1cdb7d76fde99fd748e81.tar.gz
nextcloud-server-04031f606a5ac673cdb1cdb7d76fde99fd748e81.zip
Merge pull request #18478 from nextcloud/fix/direct-editing-invalid-editor-id
Do not generate tokens for editor IDs that do not exist
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/DirectEditing/Manager.php5
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);
}