diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2019-08-22 13:43:24 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2019-08-22 13:43:24 +0200 |
commit | 0b97d9697a51f2ddca71b57bd4af57e67f9d0cd4 (patch) | |
tree | 0bccb6c52a5e74b1842c263f5355d13ccc07e0b8 /admin/WebConsole/includes/restfunctions.php | |
parent | e3b1b1e2a90629eff6d42d0004a8c1b9ae2f1cda (diff) |
#834: Setting a default value for some PHP variables to avoid warnings.
Diffstat (limited to 'admin/WebConsole/includes/restfunctions.php')
-rw-r--r-- | admin/WebConsole/includes/restfunctions.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php index 7f710adf..14cace17 100644 --- a/admin/WebConsole/includes/restfunctions.php +++ b/admin/WebConsole/includes/restfunctions.php @@ -98,14 +98,18 @@ function clients($case, $ips) { break; case 2: $type = GET; + $data = null; break; } $result = common_request(OG_REST_CMD_CLIENTS, $type, $data); - foreach ($result[OG_REST_PARAM_CLIENTS] as $client) { - $trama_notificacion = $trama_notificacion.$client[OG_REST_PARAM_ADDR].'/'. - $client[OG_REST_PARAM_STATE].';'; + $trama_notificacion = ""; + if (isset($result[OG_REST_PARAM_CLIENTS])) { + foreach ($result[OG_REST_PARAM_CLIENTS] as $client) { + $trama_notificacion .= $client[OG_REST_PARAM_ADDR].'/'. + $client[OG_REST_PARAM_STATE].';'; + } } return $trama_notificacion; |