Skip to content
Snippets Groups Projects
Commit cdba520d authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix incorrect usage of implode parameters, fixes #2729

Closes #2729

Merge request studip/studip!1847
parent 0fa2c141
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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
}
......@@ -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;
}
......
......@@ -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;
}
}
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment