diff options
author | John Klug <john.klug@multitech.com> | 2025-05-09 23:22:47 +0000 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2025-05-09 23:22:47 +0000 |
commit | d33e698296fd633d2f2d2cb6cbc45b5543fca468 (patch) | |
tree | 797cc50965a8413e21a29d4d4207e2af7b6011be | |
parent | ac8b036b7c15ef5b0b0f0abd84ee64ccc0a1510f (diff) | |
download | commissioning-d33e698296fd633d2f2d2cb6cbc45b5543fca468.tar.gz commissioning-d33e698296fd633d2f2d2cb6cbc45b5543fca468.tar.bz2 commissioning-d33e698296fd633d2f2d2cb6cbc45b5543fca468.zip |
Fix uninitialized variable issues which fails in modern PHP1.0.4
-rw-r--r-- | www/commission/index.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/www/commission/index.php b/www/commission/index.php index ae5e2ee..c4fdb65 100644 --- a/www/commission/index.php +++ b/www/commission/index.php @@ -50,7 +50,11 @@ function chk_username($userid) { if($_SERVER["REQUEST_METHOD"] == "POST"){ $mismatch = 1; // We have two different passwords - $reset = trim($_POST["reset"]); + if (!array_key_exists("reset",$_POST)) { + $reset = ""; + } else { + $reset = trim($_POST["reset"]); + } syslog(LOG_ALERT, "Reset: $reset"); if ($reset === "Reset") { $save_password = ""; @@ -149,6 +153,9 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){ $handle = popen($cmd, 'r'); $username_err = trim(fread($handle, 4192)); $status = pclose($handle); + if(! isset($result)) { + $result = ""; + } syslog(LOG_ALERT, "useradd: status: $status result: $result"); $uid = chk_username($username); if ($uid === -1) { |