Skip to content

Commit

Permalink
Fix deprecated string inline variable format (librenms#16755)
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant authored Nov 23, 2024
1 parent be0651a commit d8f7d4f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions LibreNMS/Validations/Database/CheckSchemaStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private function dropTableSql(string $table): string
*/
private function columnToSql(array $column_data): string
{
$segments = ["`${column_data['Field']}`", $column_data['Type']];
$segments = ["`{$column_data['Field']}`", $column_data['Type']];

$segments[] = $column_data['Null'] ? 'NULL' : 'NOT NULL';

Expand All @@ -274,7 +274,7 @@ private function columnToSql(array $column_data): string
} elseif ($column_data['Default'] == 'NULL') {
$segments[] = 'DEFAULT NULL';
} else {
$segments[] = "DEFAULT '${column_data['Default']}'";
$segments[] = "DEFAULT '{$column_data['Default']}'";
}
}

Expand Down
2 changes: 1 addition & 1 deletion database/seeders/DefaultAlertTemplateSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function run(): void
@if ($alert->faults)
Faults:
@foreach ($alert->faults as $key => $value)
@php($unit = __("sensors.${value["sensor_class"]}.unit"))
@php($unit = __("sensors.{$value["sensor_class"]}.unit"))
#{{ $key }}: {{ $value['sensor_descr'] ?? 'Sensor' }}
Current: {{ $value['sensor_current'].$unit }}
Expand Down
2 changes: 1 addition & 1 deletion includes/html/modal/new_bill.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
$interface = cleanPort($interface);
$string = $interface['label'] . ' - ' . \LibreNMS\Util\Clean::html($interface['ifAlias'], []);
$selected = $interface['port_id'] === $port['port_id'] ? ' selected' : '';
echo "<option value='${interface['port_id']}' $selected>$string</option>\n";
echo "<option value='{$interface['port_id']}' $selected>$string</option>\n";
}
} ?>
</select>
Expand Down
6 changes: 3 additions & 3 deletions includes/html/pages/notifications.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
echo '<div class="well"><div class="row"> <div class="col-md-12">';

$class = $notif['severity'] == 2 ? 'text-danger' : 'text-warning';
echo "<h4 class='$class' id='${notif['notifications_id']}'>";
echo "<h4 class='$class' id='{$notif['notifications_id']}'>";
echo "<strong><i class='fa fa-bell-o'></i>&nbsp;" . htmlentities($notif['title']) . '</strong>';
echo "<span class='pull-right'>";

Expand Down Expand Up @@ -125,7 +125,7 @@
} elseif ($notif['severity'] == 2) {
$class = 'text-danger';
}
echo "<h4 class='$class' id='${notif['notifications_id']}'>" . htmlentities($notif['title']) . "<span class='pull-right'>";
echo "<h4 class='$class' id='{$notif['notifications_id']}'>" . htmlentities($notif['title']) . "<span class='pull-right'>";

if (Auth::user()->hasGlobalAdmin()) {
echo '<button class="btn btn-primary fa fa-bell-o stick-notif" data-toggle="tooltip" data-placement="bottom" title="Mark as Sticky" style="margin-top:-10px;"></button>';
Expand Down Expand Up @@ -168,7 +168,7 @@
} elseif ($notif['severity'] == 2) {
echo ' class="text-danger"';
}
echo " id='${notif['notifications_id']}'>" . htmlentities($notif['title']);
echo " id='{$notif['notifications_id']}'>" . htmlentities($notif['title']);

if (Auth::user()->isAdmin()) {
echo '<span class="pull-right"><button class="btn btn-primary fa fa-bell-o stick-notif" data-toggle="tooltip" data-placement="bottom" title="Mark as Sticky" style="margin-top:-10px;"></button></span>';
Expand Down
2 changes: 1 addition & 1 deletion includes/html/table/bills.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
$background = \LibreNMS\Util\Color::percentage($percent, null);
$right_background = $background['right'];
$left_background = $background['left'];
$overuse_formatted = (($overuse <= 0) ? '-' : "<span style='color: #${background['left']}; font-weight: bold;'>$overuse_formatted</span>");
$overuse_formatted = (($overuse <= 0) ? '-' : "<span style='color: #{$background['left']}; font-weight: bold;'>$overuse_formatted</span>");

$bill_name = "<a href='$url'><span style='font-weight: bold;' class='interface'>" . htmlentities($bill['bill_name']) . '</span></a><br />' .
date('Y-m-d', strtotime($datefrom)) . ' to ' . date('Y-m-d', strtotime($dateto));
Expand Down
2 changes: 1 addition & 1 deletion poll-billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
$host = $port_data['hostname'];
$port = $port_data['port'];

echo " Polling ${port_data['ifName']} (${port_data['ifDescr']}) on ${port_data['hostname']}\n";
echo " Polling {$port_data['ifName']} ({$port_data['ifDescr']}) on {$port_data['hostname']}\n";

$port_data['in_measurement'] = Billing::getValue($port_data['hostname'], $port_data['port'], $port_data['ifIndex'], 'In');
$port_data['out_measurement'] = Billing::getValue($port_data['hostname'], $port_data['port'], $port_data['ifIndex'], 'Out');
Expand Down

0 comments on commit d8f7d4f

Please sign in to comment.