From a7e09bb5e582d207e74f849bf7c0b3fbd9ea78a3 Mon Sep 17 00:00:00 2001
From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com>
Date: Sat, 14 May 2022 13:28:20 -0400
Subject: [PATCH] Much prettier every other command
---
homepage/views.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/homepage/views.php b/homepage/views.php
index d0f2ab2..67209ea 100644
--- a/homepage/views.php
+++ b/homepage/views.php
@@ -212,7 +212,10 @@ if(isset($_GET['view'])){
$command = $_GET['submit'];
if(isset($command)){
$results = shell_exec("$command 2>&1");
- echo "
| Output of command:`".$command."` |
|---|
$results |
";
+ if(strlen($results) == 0) {
+ $results = "This command has no output.";
+ }
+ echo "| Output of command:`".$command."` |
|---|
$results |
";
} else {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');