From e9c35aacaf7544ae81afd1f27723f333f999222a Mon Sep 17 00:00:00 2001 From: System Void Date: Mon, 14 Dec 2015 16:35:39 +0000 Subject: [PATCH] Fix Undefined Var & Require $_POST['cmd']. I fixed an undefined variable in my past commit, and also enabled the requirement for the `cmd` POST field. --- web/api/index.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/api/index.php b/web/api/index.php index c4a01341..633352d5 100644 --- a/web/api/index.php +++ b/web/api/index.php @@ -32,6 +32,17 @@ if (isset($_POST['user']) || isset($_POST['hash'])) { exit; } + // Define the command to use + if (isset($_POST['cmd'])) + { + $cmd = escapeshellarg($_POST['cmd']); + } else + { + // If there's no command, just exit. + echo 'No command specified.'; + exit; + } + // Prepare for iteration $args = []; $i = 0;