Ver código fonte

Update index.php

Comments about error coming from setting PHP Directive Display Errors to ON
Initializing arg1, arg2, ...arg9 ='' may be useful to avoid this problem when calling the API from a script
Error logic may break when you get this notifies on the response
Estratos Consulting 11 anos atrás
pai
commit
2828dfc870
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      web/api/index.php

+ 4 - 1
web/api/index.php

@@ -26,7 +26,10 @@ if (isset($_POST['user']) || isset($_POST['hash'])) {
         echo 'Error: only admin is allowed to use API';
         exit;
     }
-
+    // Not Declaring arguments may cause Notifies on the response on an API Call when the Directive Dysplay errors is enabled
+    // you may  initialize argument arg1, arg2,... arg9 to = '' here
+    // Or post the unused args to =''
+    
     // Prepare arguments
     if (isset($_POST['cmd'])) $cmd = escapeshellarg($_POST['cmd']);
     if (isset($_POST['arg1'])) $arg1 = escapeshellarg($_POST['arg1']);