From d8f7d4ff85cd368fdc2f52e221f0864968849215 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sat, 23 Nov 2024 17:43:08 -0600 Subject: [PATCH] Fix deprecated string inline variable format (#16755) --- LibreNMS/Validations/Database/CheckSchemaStructure.php | 4 ++-- database/seeders/DefaultAlertTemplateSeeder.php | 2 +- includes/html/modal/new_bill.inc.php | 2 +- includes/html/pages/notifications.inc.php | 6 +++--- includes/html/table/bills.inc.php | 2 +- poll-billing.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/LibreNMS/Validations/Database/CheckSchemaStructure.php b/LibreNMS/Validations/Database/CheckSchemaStructure.php index b1d7a491b286..e0c3533c58de 100644 --- a/LibreNMS/Validations/Database/CheckSchemaStructure.php +++ b/LibreNMS/Validations/Database/CheckSchemaStructure.php @@ -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'; @@ -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']}'"; } } diff --git a/database/seeders/DefaultAlertTemplateSeeder.php b/database/seeders/DefaultAlertTemplateSeeder.php index 9ee562c79bc1..8eadaed6824f 100644 --- a/database/seeders/DefaultAlertTemplateSeeder.php +++ b/database/seeders/DefaultAlertTemplateSeeder.php @@ -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 }} diff --git a/includes/html/modal/new_bill.inc.php b/includes/html/modal/new_bill.inc.php index 2236966211a1..3feca93f9b11 100644 --- a/includes/html/modal/new_bill.inc.php +++ b/includes/html/modal/new_bill.inc.php @@ -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 "\n"; + echo "\n"; } } ?> diff --git a/includes/html/pages/notifications.inc.php b/includes/html/pages/notifications.inc.php index 13ea55b52ca0..e4045069d78d 100644 --- a/includes/html/pages/notifications.inc.php +++ b/includes/html/pages/notifications.inc.php @@ -83,7 +83,7 @@ echo '
'; $class = $notif['severity'] == 2 ? 'text-danger' : 'text-warning'; - echo "

"; + echo "

"; echo " " . htmlentities($notif['title']) . ''; echo ""; @@ -125,7 +125,7 @@ } elseif ($notif['severity'] == 2) { $class = 'text-danger'; } - echo "

" . htmlentities($notif['title']) . ""; + echo "

" . htmlentities($notif['title']) . ""; if (Auth::user()->hasGlobalAdmin()) { echo ''; @@ -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 ''; diff --git a/includes/html/table/bills.inc.php b/includes/html/table/bills.inc.php index b296cbaad12b..a5cc3cca5aae 100644 --- a/includes/html/table/bills.inc.php +++ b/includes/html/table/bills.inc.php @@ -141,7 +141,7 @@ $background = \LibreNMS\Util\Color::percentage($percent, null); $right_background = $background['right']; $left_background = $background['left']; - $overuse_formatted = (($overuse <= 0) ? '-' : "$overuse_formatted"); + $overuse_formatted = (($overuse <= 0) ? '-' : "$overuse_formatted"); $bill_name = "" . htmlentities($bill['bill_name']) . '
' . date('Y-m-d', strtotime($datefrom)) . ' to ' . date('Y-m-d', strtotime($dateto)); diff --git a/poll-billing.php b/poll-billing.php index 9235358943d2..191b875ac650 100755 --- a/poll-billing.php +++ b/poll-billing.php @@ -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');