diff --git a/functions.php b/functions.php
index b053908..952f814 100644
--- a/functions.php
+++ b/functions.php
@@ -161,21 +161,25 @@ function show_service($name, $containers) {
function show_service_update($name, $update, $uptodate) {
$str = '
'.$name."
";
- $str .= '';
$update = trim($update);
- $arr = explode(" ",$update);
- foreach ($arr as $container) {
- $str .= $container." - UPDATE AVAILABLE
";
+ if (!empty($update)) {
+ $str .= '
';
+ $arr = explode(" ",$update);
+ foreach ($arr as $container) {
+ $str .= $container." - UPDATE AVAILABLE
";
+ }
+ $str .= '
';
}
- $str .= '
';
- $str .= '';
$uptodate = trim($uptodate);
- $arr = explode(" ",$uptodate);
- foreach ($arr as $container) {
- $str .= $container." - Already up to date
";
+ if (!empty($uptodate)) {
+ $str .= '
';
+ $arr = explode(" ",$uptodate);
+ foreach ($arr as $container) {
+ $str .= $container." - Already up to date
";
+ }
+ $str .= '
';
}
- $str .= '
';
echo $str;
}
diff --git a/scan.php b/scan.php
index 3bbf77d..de8235e 100644
--- a/scan.php
+++ b/scan.php
@@ -101,7 +101,7 @@ switch ($_GET["op"]) {
if ($key=="updates") {
if ($data["INSTALL_STATUS"]==1) {
foreach ($data["INSTALLED_SERVICES"] as $service_name => $object) {
- show_service_update($service_name, $object["update"], $object["uptodate"]);
+ show_service_update($service_name, trim($object["update"]), trim($object["uptodate"]));
}
echo "
";
}