aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Siegfried <david.siegfried@uni-vechta.de>2023-03-03 21:27:11 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2023-03-03 21:27:11 +0000
commit930bebbafeb70b813ee83afec9c434838f056413 (patch)
tree0c8e1e1b053524a0ade75990c4d2c751e0203fe2 /lib
parent4292f9fd57bf9869a256674ce3bec938ec11e4ec (diff)
prevent php-warnings, closes #2256
Closes #2256 Merge request studip/studip!1486
Diffstat (limited to 'lib')
-rw-r--r--lib/classes/ForumActivity.php6
-rw-r--r--lib/classes/LtiLink.php17
2 files changed, 15 insertions, 8 deletions
diff --git a/lib/classes/ForumActivity.php b/lib/classes/ForumActivity.php
index 0e8b3de..63dcbf2 100644
--- a/lib/classes/ForumActivity.php
+++ b/lib/classes/ForumActivity.php
@@ -22,7 +22,7 @@ class ForumActivity
*/
public static function newEntry($event, $topic_id, $post)
{
- $verb = $post['depth'] === 3 ? 'answered' : 'created';
+ $verb = isset($post['depth']) && $post['depth'] === 3 ? 'answered' : 'created';
if ($verb === 'created') {
if (isset($post['depth']) && (int)$post['depth'] === 1) {
@@ -41,7 +41,7 @@ class ForumActivity
* Post activity for updating a forum post
* @param string $event
* @param string $topic_id
- * @param string $post
+ * @param array $post
*/
public static function updateEntry($event, $topic_id, $post)
{
@@ -69,7 +69,7 @@ class ForumActivity
* Post activity for deleting a forum post
* $param string $event
* @param string $topic_id
- * @param string $post
+ * @param array $post
*/
public static function deleteEntry($event, $topic_id, $post)
{
diff --git a/lib/classes/LtiLink.php b/lib/classes/LtiLink.php
index 546a533..28b7b9f 100644
--- a/lib/classes/LtiLink.php
+++ b/lib/classes/LtiLink.php
@@ -187,7 +187,7 @@ class LtiLink
/**
* Add a list of additional launch parameters to this LTI launch request.
*
- * @param string $params list of launch parameters
+ * @param array $params list of launch parameters
*/
public function addLaunchParameters($params)
{
@@ -217,7 +217,7 @@ class LtiLink
/**
* Add a list of custom launch parameters to this LTI launch request.
*
- * @param string $params list of custom parameters
+ * @param array $params list of custom parameters
*/
public function addCustomParameters($params)
{
@@ -244,7 +244,7 @@ class LtiLink
/**
* Add a list of substitution variables to this LTI launch request.
*
- * @param string $variables list of substitution variables
+ * @param array $variables list of substitution variables
*/
public function addVariables($variables)
{
@@ -292,8 +292,15 @@ class LtiLink
*/
public function getLaunchSignature($launch_params)
{
- list($launch_url, $fragment) = explode('#', $this->launch_url);
- list($launch_url, $query) = explode('?', $launch_url);
+ $launch_url = $this->launch_url;
+
+ if (strpos($launch_url, '#') !== false) {
+ $launch_url = explode('#', $launch_url)[0];
+ }
+
+ if (strpos($launch_url, '?') !== false) {
+ list($launch_url, $query) = explode('?', $launch_url);
+ }
if (isset($query)) {
parse_str($query, $query_params);