From 49b82201c7631d2242bc6f706ebdc527fdb94708 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sun, 8 Feb 2015 12:43:04 +0100 Subject: [PATCH] fix undefined variable in cases 'custom-notes-show' is not set when adding/editing an admin/a customer Signed-off-by: Michael Kaufmann (d00p) --- admin_admins.php | 10 ++++++++-- admin_customers.php | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/admin_admins.php b/admin_admins.php index 39a4f52c..f23818de 100644 --- a/admin_admins.php +++ b/admin_admins.php @@ -202,7 +202,10 @@ if ($page == 'admins' $email = $idna_convert->encode(validate($_POST['email'], 'email')); $custom_notes = validate(str_replace("\r\n", "\n", $_POST['custom_notes']), 'custom_notes', '/^[^\0]*$/'); - $custom_notes_show = intval_ressource($_POST['custom_notes_show']); + $custom_notes_show = 0; + if (isset($_POST['custom_notes_show'])) { + $custom_notes_show = intval_ressource($_POST['custom_notes_show']); + } $loginname = validate($_POST['loginname'], 'loginname'); $password = validate($_POST['admin_password'], 'password'); @@ -498,7 +501,10 @@ if ($page == 'admins' $email = $idna_convert->encode(validate($_POST['email'], 'email')); $custom_notes = validate(str_replace("\r\n", "\n", $_POST['custom_notes']), 'custom_notes', '/^[^\0]*$/'); - $custom_notes_show = intval_ressource($_POST['custom_notes_show']); + $custom_notes_show = $result['custom_notes_show']; + if (isset($_POST['custom_notes_show'])) { + $custom_notes_show = intval_ressource($_POST['custom_notes_show']); + } if ($result['adminid'] == $userinfo['userid']) { diff --git a/admin_customers.php b/admin_customers.php index cd660efc..0b179d94 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -420,7 +420,10 @@ if ($page == 'customers' $gender = intval_ressource($_POST['gender']); $custom_notes = validate(str_replace("\r\n", "\n", $_POST['custom_notes']), 'custom_notes', '/^[^\0]*$/'); - $custom_notes_show = intval_ressource($_POST['custom_notes_show']); + $custom_notes_show = 0; + if (isset($_POST['custom_notes_show'])) { + $custom_notes_show = intval_ressource($_POST['custom_notes_show']); + } $diskspace = intval_ressource($_POST['diskspace']); if (isset($_POST['diskspace_ul'])) { @@ -1073,7 +1076,10 @@ if ($page == 'customers' $move_to_admin = isset($_POST['move_to_admin']) ? intval_ressource($_POST['move_to_admin']) : 0; $custom_notes = validate(str_replace("\r\n", "\n", $_POST['custom_notes']), 'custom_notes', '/^[^\0]*$/'); - $custom_notes_show = intval_ressource($_POST['custom_notes_show']); + $custom_notes_show = $result['custom_notes_show']; + if (isset($_POST['custom_notes_show'])) { + $custom_notes_show = intval_ressource($_POST['custom_notes_show']); + } $diskspace = intval_ressource($_POST['diskspace']); if (isset($_POST['diskspace_ul'])) {