From d33e698296fd633d2f2d2cb6cbc45b5543fca468 Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 9 May 2025 23:22:47 +0000 Subject: Fix uninitialized variable issues which fails in modern PHP --- www/commission/index.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3