diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2020-04-02 18:55:32 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2020-04-02 18:55:32 +0200 |
commit | a9a6da5e850d0e6f4ae5ef76792b5579f766d4f6 (patch) | |
tree | 41a1084ec0cb31a46d76603b7979b949686d10c1 /admin | |
parent | f83884537cffd1ca56712aada796f585491a5115 (diff) |
#839: Fix index overflow in REST route `GET /ous/{ouid}/labs/{labid}/clients/status`
Diffstat (limited to 'admin')
-rw-r--r-- | admin/WebConsole/rest/server.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/admin/WebConsole/rest/server.php b/admin/WebConsole/rest/server.php index 50ee5f67..c55d6709 100644 --- a/admin/WebConsole/rest/server.php +++ b/admin/WebConsole/rest/server.php @@ -167,12 +167,13 @@ EOD; } else { // Multiple responses. foreach ($stat as $ip => $st) { - $tmp = Array(); - $tmp['id'] = (int)$id[$ip]; - $tmp['ip'] = $ip; - $tmp['status'] = $stat[$ip]; - empty($logged[$ip]) || $tmp['loggedin'] = $logged[$ip]; - array_push($response, $tmp); + if (isset($id[$ip])) { + $tmp = ['id' => (int)$id[$ip], + 'ip' => $ip, + 'status' => $stat[$ip]]; + empty($logged[$ip]) || $tmp['loggedin'] = $logged[$ip]; + array_push($response, $tmp); + } } } jsonResponse(200, $response); |