Skip to content

Commit e9c35aa

Browse files
committed
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.
1 parent 332ef27 commit e9c35aa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

web/api/index.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232
exit;
3333
}
3434

35+
// Define the command to use
36+
if (isset($_POST['cmd']))
37+
{
38+
$cmd = escapeshellarg($_POST['cmd']);
39+
} else
40+
{
41+
// If there's no command, just exit.
42+
echo 'No command specified.';
43+
exit;
44+
}
45+
3546
// Prepare for iteration
3647
$args = [];
3748
$i = 0;

0 commit comments

Comments
 (0)