Skip to content

Commit

Permalink
LTI: Authentication check for registering new LTI providers and escap…
Browse files Browse the repository at this point in the history
…ed HTML in the provider title in the setup form
  • Loading branch information
ZallaxDev committed Dec 2, 2024
1 parent d8a9981 commit 0647209
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function initForm(string $formaction, string $saveCmd, string $cancelCmd)
}

$titleInp = new ilTextInputGUI($lng->txt('lti_con_prov_title'), 'title');
$titleInp->setValue($this->provider->getTitle());
$titleInp->setValue(htmlspecialchars($this->provider->getTitle()));
$titleInp->setRequired(true);
$this->addItem($titleInp);

Expand Down
7 changes: 2 additions & 5 deletions components/ILIAS/LTIConsumer/ltiregstart.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@
ilInitialisation::initILIAS();
global $DIC;

if (strtoupper($DIC->http()->request()->getMethod()) !== "GET") {
$DIC->http()->saveResponse(
$DIC->http()->response()
->withStatus(400)
);
if (!$DIC->user()->getId() || $DIC->user()->getId() === ANONYMOUS_USER_ID) {
ilObjLTIConsumer::sendResponseError(401, "unauthorized");
}

$params = $DIC->http()->wrapper()->query();
Expand Down

0 comments on commit 0647209

Please sign in to comment.