forked from Business/BinStack
Improve isManagerOf() error handling to prevent possible security bug
This commit is contained in:
parent
d749564a53
commit
112599d162
@ -90,10 +90,10 @@ function isManagerOf($m, $e) {
|
|||||||
|
|
||||||
$resp = json_decode($response->getBody(), TRUE);
|
$resp = json_decode($response->getBody(), TRUE);
|
||||||
if ($resp['status'] == "OK") {
|
if ($resp['status'] == "OK") {
|
||||||
return $resp['managerof'];
|
return $resp['managerof'] === true;
|
||||||
} else {
|
} else {
|
||||||
// this shouldn't happen, but in case it does just fake it.
|
// this shouldn't happen, but in case it does just fake it.
|
||||||
return ["name" => $u, "username" => $u, "uid" => $u];
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user