diff options
| author | David Siegfried <david.siegfried@uni-vechta.de> | 2023-03-03 21:27:11 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-03-03 21:27:11 +0000 |
| commit | 930bebbafeb70b813ee83afec9c434838f056413 (patch) | |
| tree | 0c8e1e1b053524a0ade75990c4d2c751e0203fe2 /app/controllers/course/lti.php | |
| parent | 4292f9fd57bf9869a256674ce3bec938ec11e4ec (diff) | |
prevent php-warnings, closes #2256
Closes #2256
Merge request studip/studip!1486
Diffstat (limited to 'app/controllers/course/lti.php')
| -rw-r--r-- | app/controllers/course/lti.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/controllers/course/lti.php b/app/controllers/course/lti.php index 2183aae..7ed8586 100644 --- a/app/controllers/course/lti.php +++ b/app/controllers/course/lti.php @@ -242,8 +242,8 @@ class Course_LtiController extends StudipController ]); foreach ($custom_parameters as $param) { - list($key, $value) = explode('=', $param, 2); - if (isset($value)) { + if (strpos($param, '=') !== false) { + list($key, $value) = explode('=', $param, 2); $lti_link->addCustomParameter(trim($key), trim($value)); } } @@ -291,13 +291,12 @@ class Course_LtiController extends StudipController $lti_data->description = Studip\Markup::purifyHtml(Studip\Markup::markAsHtml($item['text'])); $lti_data->tool_id = $tool_id; $lti_data->launch_url = (string) $item['url']; - $custom_parameters = ''; $options = []; if (is_array($item['custom'])) { + $custom_parameters = ''; foreach ($item['custom'] as $key => $value) { $custom_parameters .= $key . '=' . $value . "\n"; } - $options['custom_parameters'] = $custom_parameters; } @@ -352,8 +351,8 @@ class Course_LtiController extends StudipController ]); foreach ($custom_parameters as $param) { - list($key, $value) = explode('=', $param, 2); - if (isset($value)) { + if (strpos($param, '=') !== false) { + list($key, $value) = explode('=', $param, 2); $lti_link->addCustomParameter(trim($key), trim($value)); } } |
