aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2023-06-13 13:14:44 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2023-06-13 13:14:44 +0000
commitcdba520d92857e679e6cbc6486bd16b0217d8daf (patch)
treecce3bd96dd3a9ae9b133703e709dd0ee07d41737 /lib
parent0fa2c1411fb33c79265848e6941189cf2ad7c74d (diff)
fix incorrect usage of implode parameters, fixes #2729
Closes #2729 Merge request studip/studip!1847
Diffstat (limited to 'lib')
-rw-r--r--lib/elearning/Ilias3ConnectedPermissions.class.php6
-rw-r--r--lib/elearning/Ilias3ContentModule.class.php1
-rw-r--r--lib/elearning/Ilias3Soap.class.php6
-rw-r--r--lib/elearning/Ilias4Soap.class.php4
-rw-r--r--lib/elearning/Ilias5Soap.class.php4
-rw-r--r--lib/ilias_interface/IliasSoap.class.php6
-rw-r--r--lib/models/MvvFileFileref.php2
-rw-r--r--lib/soap/StudipSoapClient.class.php13
8 files changed, 19 insertions, 23 deletions
diff --git a/lib/elearning/Ilias3ConnectedPermissions.class.php b/lib/elearning/Ilias3ConnectedPermissions.class.php
index 9bf2fcd..5ac5f59 100644
--- a/lib/elearning/Ilias3ConnectedPermissions.class.php
+++ b/lib/elearning/Ilias3ConnectedPermissions.class.php
@@ -111,8 +111,6 @@ class Ilias3ConnectedPermissions extends ConnectedPermissions
}
}
}
-// if ($GLOBALS["debug"] == true)
-// echo "P$proper_role A$active_role U" . $user_crs_role . " R" . implode($connected_cms[$this->cms_type]->user->getRoles(), ".")."<br>";
}
// is user already course-member? otherwise add member with proper role
@@ -205,9 +203,9 @@ class Ilias3ConnectedPermissions extends ConnectedPermissions
$module_id,
$connected_cms[$this->cms_type]->user->getId()
);
-// echo "MID".$module_id."UID".$connected_cms[$this->cms_type]->user->getId()."OPS".implode($this->tree_allowed_operations,"-") ;
- if (! is_array($this->tree_allowed_operations))
+ if (!is_array($this->tree_allowed_operations)) {
return false;
+ }
$no_permission = false;
if (isset($current_module)) { //TODO: fixes Warning:Creating default object from empty value - possible side effects
diff --git a/lib/elearning/Ilias3ContentModule.class.php b/lib/elearning/Ilias3ContentModule.class.php
index 63857bf..3067575 100644
--- a/lib/elearning/Ilias3ContentModule.class.php
+++ b/lib/elearning/Ilias3ContentModule.class.php
@@ -62,7 +62,6 @@ class Ilias3ContentModule extends ContentModule
$user_name = trim($user_data["title"] . " " . $user_data["firstname"] . " " . $user_data["lastname"]);
$this->setAuthors($user_name);
}
-// echo $object_data["accessInfo"] . ": " . implode($object_data["operations"], ".");
$this->setPermissions($object_data["accessInfo"], $object_data["operations"]);
}
else
diff --git a/lib/elearning/Ilias3Soap.class.php b/lib/elearning/Ilias3Soap.class.php
index 6a43b9b..4fc5a65 100644
--- a/lib/elearning/Ilias3Soap.class.php
+++ b/lib/elearning/Ilias3Soap.class.php
@@ -93,7 +93,7 @@ class Ilias3Soap extends StudipSoapClient
*/
function call($method, $params)
{
- $index = md5($method . ":" . implode($params, "-"));
+ $index = md5($method . ":" . implode('-', $params));
// return false if no session_id is given
if (($method != "login") AND ($params["sid"] == ""))
return false;
@@ -597,9 +597,9 @@ class Ilias3Soap extends StudipSoapClient
{
$objects = $this->parseXML($result);
$roles = [];
- foreach ($objects as $count => $role)
+ foreach ($objects as $count => $role) {
$roles[$count] = $role["obj_id"];
-// echo implode($roles, ".");
+ }
return $roles;
}
return false;
diff --git a/lib/elearning/Ilias4Soap.class.php b/lib/elearning/Ilias4Soap.class.php
index 9172338..27c28fb 100644
--- a/lib/elearning/Ilias4Soap.class.php
+++ b/lib/elearning/Ilias4Soap.class.php
@@ -141,7 +141,7 @@ class Ilias4Soap extends Ilias3Soap
}
if (is_array($path)) {
- return implode($path, $this->separator_string);
+ return implode($this->separator_string, $path);
} else {
return false;
}
@@ -173,7 +173,7 @@ class Ilias4Soap extends Ilias3Soap
}
if (is_array($path)) {
- return implode($path, '_');
+ return implode('_', $path);
} else {
return false;
}
diff --git a/lib/elearning/Ilias5Soap.class.php b/lib/elearning/Ilias5Soap.class.php
index 80c683d..cf8bd4c 100644
--- a/lib/elearning/Ilias5Soap.class.php
+++ b/lib/elearning/Ilias5Soap.class.php
@@ -30,7 +30,7 @@ class Ilias5Soap extends Ilias4Soap
*/
function call($method, $params)
{
- $index = md5($method . ":" . implode($params, "-"));
+ $index = md5($method . ":" . implode('-', $params));
// return false if no session_id is given
if (($method != "login") AND ($params["sid"] == ""))
return false;
@@ -111,4 +111,4 @@ class Ilias5Soap extends Ilias4Soap
$result = $this->call('login', $param);
return $result;
}
-} \ No newline at end of file
+}
diff --git a/lib/ilias_interface/IliasSoap.class.php b/lib/ilias_interface/IliasSoap.class.php
index 231b8e9..e140a9f 100644
--- a/lib/ilias_interface/IliasSoap.class.php
+++ b/lib/ilias_interface/IliasSoap.class.php
@@ -111,7 +111,7 @@ class IliasSoap extends StudipSoapClient
return false;
}
- $cache_index = md5($method . ':' . implode($params, '-'));
+ $cache_index = md5($method . ':' . implode('-', $params));
if ($this->caching_active && isset($this->soap_cache[$cache_index]) && $method !== 'login') {
$result = $this->soap_cache[$cache_index];
} else {
@@ -1128,7 +1128,7 @@ class IliasSoap extends StudipSoapClient
}
if (is_array($path)) {
- return implode($path, $this->separator_string);
+ return implode($this->separator_string, $path);
} else {
return false;
}
@@ -1160,7 +1160,7 @@ class IliasSoap extends StudipSoapClient
}
if (is_array($path)) {
- return implode($path, '_');
+ return implode('_', $path);
} else {
return false;
}
diff --git a/lib/models/MvvFileFileref.php b/lib/models/MvvFileFileref.php
index 13be9e1..0771055 100644
--- a/lib/models/MvvFileFileref.php
+++ b/lib/models/MvvFileFileref.php
@@ -83,7 +83,7 @@ class MvvFileFileref extends ModuleManagementModel
list($category, $type) = explode('/', $mime_type, 2);
if ($category == 'application') {
foreach ($application_category as $name => $type_name) {
- if (preg_match('/' . implode($type_name, '|') . '/i', $type)) {
+ if (preg_match('/' . implode('|', $type_name) . '/i', $type)) {
return $name;
}
}
diff --git a/lib/soap/StudipSoapClient.class.php b/lib/soap/StudipSoapClient.class.php
index 01b1392..f6c0cad 100644
--- a/lib/soap/StudipSoapClient.class.php
+++ b/lib/soap/StudipSoapClient.class.php
@@ -32,15 +32,14 @@ class StudipSoapClient
{
$this->faultstring = $result["faultstring"];
if (!in_array(mb_strtolower($this->faultstring), ["session not valid","session invalid", "session idled"]))
- $this->error .= "<b>" . sprintf(_("SOAP-Fehler, Funktion \"%s\":"), $method) . "</b> " . $result["faultstring"] . " (" . $result["faultcode"] . ")<br>"; //.implode($params,"-");
- }
- else
- {
+ $this->error .= "<b>" . sprintf(_("SOAP-Fehler, Funktion \"%s\":"), $method) . "</b> " . $result["faultstring"] . " (" . $result["faultcode"] . ")<br>";
+ } else {
$err = $this->soap_client->getError();
- if ($err)
- $this->error .= "<b>" . sprintf(_("SOAP-Fehler, Funktion \"%s\":"), $method) . "</b> " . $err . "<br>"; //.implode($params,"-") . htmlspecialchars($this->soap_client->response, ENT_QUOTES);
- else
+ if ($err) {
+ $this->error .= "<b>" . sprintf(_("SOAP-Fehler, Funktion \"%s\":"), $method) . "</b> " . $err . "<br>";
+ } else {
return $result;
+ }
}
error_log($this->error);
return false;