Fix security fix breaking display (#15192)

Escaped a <br />
This commit is contained in:
Tony Murray
2023-08-03 11:02:55 -05:00
committed by GitHub
parent 77fc6a34df
commit e0a20fced0

View File

@@ -154,7 +154,7 @@ class DeviceController extends TableController
'hostname' => $this->getHostname($device),
'metrics' => $this->getMetrics($device),
'hardware' => htmlspecialchars(Rewrite::ciscoHardware($device)),
'os' => htmlspecialchars($this->getOsText($device)),
'os' => $this->getOsText($device),
'uptime' => (! $device->status && ! $device->last_polled) ? __('Never polled') : Time::formatInterval($device->status ? $device->uptime : $device->last_polled->diffInSeconds(), true),
'location' => htmlspecialchars($this->getLocation($device)),
'actions' => view('device.actions', ['actions' => $this->getActions($device)])->__toString(),
@@ -223,10 +223,10 @@ class DeviceController extends TableController
*/
private function getOsText($device)
{
$os_text = Config::getOsSetting($device->os, 'text');
$os_text = htmlspecialchars(Config::getOsSetting($device->os, 'text'));
if ($this->isDetailed()) {
$os_text .= '<br />' . $device->version . ($device->features ? " ($device->features)" : '');
$os_text .= '<br />' . htmlspecialchars($device->version . ($device->features ? " ($device->features)" : ''));
}
return $os_text;