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 ...@@ -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 // is user already course-member? otherwise add member with proper role
...@@ -205,9 +203,9 @@ class Ilias3ConnectedPermissions extends ConnectedPermissions ...@@ -205,9 +203,9 @@ class Ilias3ConnectedPermissions extends ConnectedPermissions
$module_id, $module_id,
$connected_cms[$this->cms_type]->user->getId() $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; return false;
}
$no_permission = false; $no_permission = false;
if (isset($current_module)) { //TODO: fixes Warning:Creating default object from empty value - possible side effects if (isset($current_module)) { //TODO: fixes Warning:Creating default object from empty value - possible side effects
......
...@@ -62,7 +62,6 @@ class Ilias3ContentModule extends ContentModule ...@@ -62,7 +62,6 @@ class Ilias3ContentModule extends ContentModule
$user_name = trim($user_data["title"] . " " . $user_data["firstname"] . " " . $user_data["lastname"]); $user_name = trim($user_data["title"] . " " . $user_data["firstname"] . " " . $user_data["lastname"]);
$this->setAuthors($user_name); $this->setAuthors($user_name);
} }
// echo $object_data["accessInfo"] . ": " . implode($object_data["operations"], ".");
$this->setPermissions($object_data["accessInfo"], $object_data["operations"]); $this->setPermissions($object_data["accessInfo"], $object_data["operations"]);
} }
else else
......
...@@ -93,7 +93,7 @@ class Ilias3Soap extends StudipSoapClient ...@@ -93,7 +93,7 @@ class Ilias3Soap extends StudipSoapClient
*/ */
function call($method, $params) function call($method, $params)
{ {
$index = md5($method . ":" . implode($params, "-")); $index = md5($method . ":" . implode('-', $params));
// return false if no session_id is given // return false if no session_id is given
if (($method != "login") AND ($params["sid"] == "")) if (($method != "login") AND ($params["sid"] == ""))
return false; return false;
...@@ -597,9 +597,9 @@ class Ilias3Soap extends StudipSoapClient ...@@ -597,9 +597,9 @@ class Ilias3Soap extends StudipSoapClient
{ {
$objects = $this->parseXML($result); $objects = $this->parseXML($result);
$roles = []; $roles = [];
foreach ($objects as $count => $role) foreach ($objects as $count => $role) {
$roles[$count] = $role["obj_id"]; $roles[$count] = $role["obj_id"];
// echo implode($roles, "."); }
return $roles; return $roles;
} }
return false; return false;
......
...@@ -141,7 +141,7 @@ class Ilias4Soap extends Ilias3Soap ...@@ -141,7 +141,7 @@ class Ilias4Soap extends Ilias3Soap
} }
if (is_array($path)) { if (is_array($path)) {
return implode($path, $this->separator_string); return implode($this->separator_string, $path);
} else { } else {
return false; return false;
} }
...@@ -173,7 +173,7 @@ class Ilias4Soap extends Ilias3Soap ...@@ -173,7 +173,7 @@ class Ilias4Soap extends Ilias3Soap
} }
if (is_array($path)) { if (is_array($path)) {
return implode($path, '_'); return implode('_', $path);
} else { } else {
return false; return false;
} }
......
...@@ -30,7 +30,7 @@ class Ilias5Soap extends Ilias4Soap ...@@ -30,7 +30,7 @@ class Ilias5Soap extends Ilias4Soap
*/ */
function call($method, $params) function call($method, $params)
{ {
$index = md5($method . ":" . implode($params, "-")); $index = md5($method . ":" . implode('-', $params));
// return false if no session_id is given // return false if no session_id is given
if (($method != "login") AND ($params["sid"] == "")) if (($method != "login") AND ($params["sid"] == ""))
return false; return false;
...@@ -111,4 +111,4 @@ class Ilias5Soap extends Ilias4Soap ...@@ -111,4 +111,4 @@ class Ilias5Soap extends Ilias4Soap
$result = $this->call('login', $param); $result = $this->call('login', $param);
return $result; return $result;
} }
} }
\ No newline at end of file
...@@ -111,7 +111,7 @@ class IliasSoap extends StudipSoapClient ...@@ -111,7 +111,7 @@ class IliasSoap extends StudipSoapClient
return false; 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') { if ($this->caching_active && isset($this->soap_cache[$cache_index]) && $method !== 'login') {
$result = $this->soap_cache[$cache_index]; $result = $this->soap_cache[$cache_index];
} else { } else {
...@@ -1128,7 +1128,7 @@ class IliasSoap extends StudipSoapClient ...@@ -1128,7 +1128,7 @@ class IliasSoap extends StudipSoapClient
} }
if (is_array($path)) { if (is_array($path)) {
return implode($path, $this->separator_string); return implode($this->separator_string, $path);
} else { } else {
return false; return false;
} }
...@@ -1160,7 +1160,7 @@ class IliasSoap extends StudipSoapClient ...@@ -1160,7 +1160,7 @@ class IliasSoap extends StudipSoapClient
} }
if (is_array($path)) { if (is_array($path)) {
return implode($path, '_'); return implode('_', $path);
} else { } else {
return false; return false;
} }
......
...@@ -83,7 +83,7 @@ class MvvFileFileref extends ModuleManagementModel ...@@ -83,7 +83,7 @@ class MvvFileFileref extends ModuleManagementModel
list($category, $type) = explode('/', $mime_type, 2); list($category, $type) = explode('/', $mime_type, 2);
if ($category == 'application') { if ($category == 'application') {
foreach ($application_category as $name => $type_name) { 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; return $name;
} }
} }
......
...@@ -32,15 +32,14 @@ class StudipSoapClient ...@@ -32,15 +32,14 @@ class StudipSoapClient
{ {
$this->faultstring = $result["faultstring"]; $this->faultstring = $result["faultstring"];
if (!in_array(mb_strtolower($this->faultstring), ["session not valid","session invalid", "session idled"])) 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,"-"); $this->error .= "<b>" . sprintf(_("SOAP-Fehler, Funktion \"%s\":"), $method) . "</b> " . $result["faultstring"] . " (" . $result["faultcode"] . ")<br>";
} } else {
else
{
$err = $this->soap_client->getError(); $err = $this->soap_client->getError();
if ($err) if ($err) {
$this->error .= "<b>" . sprintf(_("SOAP-Fehler, Funktion \"%s\":"), $method) . "</b> " . $err . "<br>"; //.implode($params,"-") . htmlspecialchars($this->soap_client->response, ENT_QUOTES); $this->error .= "<b>" . sprintf(_("SOAP-Fehler, Funktion \"%s\":"), $method) . "</b> " . $err . "<br>";
else } else {
return $result; return $result;
}
} }
error_log($this->error); error_log($this->error);
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment