mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Misc errors cleanup (#14257)
* Misc errors cleanup * Rename the variable in the loop to match Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -109,7 +109,7 @@ class Plugins
|
||||
|
||||
foreach ((array) $hooks as $hookName) {
|
||||
if ($hookName[0] != '_') {
|
||||
self::$plugins[$hookName][] = $class;
|
||||
self::$plugins[$hookName][] = $plugin;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,12 +183,12 @@ class Plugins
|
||||
|
||||
ob_start();
|
||||
if (! empty(self::$plugins[$hook])) {
|
||||
foreach (self::$plugins[$hook] as $name) {
|
||||
foreach (self::$plugins[$hook] as $plugin) {
|
||||
try {
|
||||
if (! is_array($params)) {
|
||||
@call_user_func([$name, $hook]);
|
||||
@call_user_func([$plugin, $hook]);
|
||||
} else {
|
||||
@call_user_func_array([$name, $hook], $params);
|
||||
@call_user_func_array([$plugin, $hook], $params);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
Log::error($e);
|
||||
|
@@ -1289,7 +1289,7 @@ function cache_peeringdb()
|
||||
$ix_json = $get_ix->body();
|
||||
$ix_data = json_decode($ix_json);
|
||||
$peers = $ix_data->{'data'};
|
||||
foreach ($peers as $index => $peer) {
|
||||
foreach ($peers ?? [] as $index => $peer) {
|
||||
$peer_name = get_astext($peer->{'asn'});
|
||||
$tmp_peer = dbFetchRow('SELECT * FROM `pdb_ix_peers` WHERE `peer_id` = ? AND `ix_id` = ?', [$peer->{'id'}, $ixid]);
|
||||
if ($tmp_peer) {
|
||||
|
Reference in New Issue
Block a user