Skip to content

Commit 6288a43

Browse files
authored
Fix Undefined array key "afi" in bgp.inc.php (librenms#18083)
We need to make sure we wrap the ternary check in parentheses so it can do the evaluation rather than executing `$peer['afi']` first - leading to a php error
1 parent 794d2ea commit 6288a43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/html/pages/routing/bgp.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
<td width=30><b>&#187;</b></td>
326326
<td width=150>' . $peeraddresslink . '<br />' . Url::deviceLink($peer_device, vars: ['tab' => 'routing', 'proto' => 'bgp']) . "</td>
327327
<td width=50><b>$peer_type</b></td>
328-
<td width=50>" . $peer['afi'] ?? '' . '</td>
328+
<td width=50>" . ($peer['afi'] ?? '') . '</td>
329329
<td><strong>AS' . $peer['bgpPeerRemoteAs'] . '</strong><br />' . $peer['astext'] . '</td>
330330
<td>' . $peer['bgpPeerDescr'] . "</td>
331331
<td><strong><span style='color: $admin_col;'>" . $peer['bgpPeerAdminStatus'] . "</span><br /><span style='color: $col;'>" . $peer['bgpPeerState'] . '</span></strong></td>

0 commit comments

Comments
 (0)