Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Do not generate tokens for editor IDs that do not exist
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Dec 19, 2019
commit 4ff11e395519987af95ffc62d7a8f0094b6978ff
5 changes: 5 additions & 0 deletions lib/private/DirectEditing/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
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 {

Expand Down Expand Up @@ -140,6 +142,9 @@ public function open(string $filePath, string $editorId = null): string {
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);
}
Expand Down