diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index b11033b78f..6a94719f1d 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -744,4 +744,12 @@ function shorten_interface_type($string) { ); } +function clean_bootgrid($string) { + + $output = str_replace(array("\r","\n"), "", $string); + $output = addslashes($output); + return $output; + +} + ?> diff --git a/html/pages/devices.inc.php b/html/pages/devices.inc.php index ff3d1cebb5..9305c519f0 100644 --- a/html/pages/devices.inc.php +++ b/html/pages/devices.inc.php @@ -218,11 +218,12 @@ var grid = $("#devices").bootgrid({ foreach (dbFetch('SELECT `os` FROM `devices` AS D WHERE 1 GROUP BY `os` ORDER BY `os`') as $data) { if ($data['os']) { - echo('""+'); + echo('">'.$config['os'][$tmp_os]['text'].'"+'); } } ?> @@ -235,7 +236,7 @@ foreach (dbFetch('SELECT `os` FROM `devices` AS D WHERE 1 GROUP BY `os` ORDER BY foreach (dbFetch('SELECT `version` FROM `devices` AS D WHERE 1 GROUP BY `version` ORDER BY `version`') as $data) { if ($data['version']) { - $tmp_version = str_replace(array("\r","\n"), "", $data['version']); + $tmp_version = clean_bootgrid($data['version']); echo('""+'); + echo('">'.$tmp_hardware.'"+'); } } @@ -273,11 +275,12 @@ foreach (dbFetch('SELECT `features` FROM `devices` AS D WHERE 1 GROUP BY `featur { if ($data['features']) { - echo('""+'); + echo('">'.$tmp_features.'"+'); } } @@ -293,6 +296,7 @@ foreach (dbFetch('SELECT `features` FROM `devices` AS D WHERE 1 GROUP BY `featur foreach (getlocations() as $location) { if ($location) { + $location = clean_bootgrid($location); echo('"