Improve isManagerOf() error handling to prevent possible security bug

This commit is contained in:
Skylar Ittner 2018-01-03 21:56:43 -07:00
parent c414dff049
commit bad43ff93f

View File

@ -90,10 +90,10 @@ function isManagerOf($m, $e) {
$resp = json_decode($response->getBody(), TRUE);
if ($resp['status'] == "OK") {
return $resp['managerof'];
return $resp['managerof'] === true;
} else {
// this shouldn't happen, but in case it does just fake it.
return ["name" => $u, "username" => $u, "uid" => $u];
return false;
}
}