Jelajahi Sumber

Merge pull request #545 from SysVoid/patch-8

Fix Undefined Var & Require $_POST['cmd'].
Serghey Rodin 10 tahun lalu
induk
melakukan
d3a7c6fac7
1 mengubah file dengan 11 tambahan dan 0 penghapusan
  1. 11 0
      web/api/index.php

+ 11 - 0
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;