summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2020-04-02 18:55:32 +0200
committerRamón M. Gómez <ramongomez@us.es>2020-04-02 18:55:32 +0200
commita9a6da5e850d0e6f4ae5ef76792b5579f766d4f6 (patch)
tree41a1084ec0cb31a46d76603b7979b949686d10c1
parentf83884537cffd1ca56712aada796f585491a5115 (diff)
#839: Fix index overflow in REST route `GET /ous/{ouid}/labs/{labid}/clients/status`
-rw-r--r--admin/WebConsole/rest/server.php13
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);