diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2025-02-11 11:40:55 +0100 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2025-04-25 14:42:17 +0200 |
| commit | 8f9929881980254601840949c056ca6216268a37 (patch) | |
| tree | 1ffeda000db7092450823e7ddd18bf96f5fea43f | |
| parent | 1cbadb74f0998a29b1332770542167ac7cd9a0d0 (diff) | |
fixed errors
| -rw-r--r-- | app/controllers/lti/ags.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/controllers/lti/ags.php b/app/controllers/lti/ags.php index c5a4105..00d8aa8 100644 --- a/app/controllers/lti/ags.php +++ b/app/controllers/lti/ags.php @@ -48,10 +48,9 @@ class Lti_AgsController extends StudipController $line_item_repo = new LineItemRepository(); $validator = new RequestAccessTokenValidator($reg_manager); $handler = null; - $deployment_id = $action; - $real_action = $args[0]; + $real_action = $args[0] ?? ''; if ($real_action === 'line_item') { - if (empty($args)) { + if (count($args) === 1) { if (Request::isPut()) { //Update a line item: $handler = new UpdateLineItemServiceServerRequestHandler($line_item_repo); @@ -77,7 +76,7 @@ class Lti_AgsController extends StudipController } } else { //Invalid endpoint. - throw new AccessDeniedException(studip_interpolate('Invalid endpoint: %{endpoint}', ['endpoint' => $action])); + throw new AccessDeniedException(studip_interpolate('Invalid endpoint: %{endpoint}', ['endpoint' => $real_action])); } if (!$handler) { throw new \Studip\LTIException('No handler available for this request.'); |
