From ee498f703d2d969bb873370d4bb5797d28aa3b3b Mon Sep 17 00:00:00 2001 From: nathangray Date: Fri, 3 Jul 2020 09:25:51 -0600 Subject: [PATCH] Etemplate: Fix password widget could not be cleared entirely --- api/src/Etemplate/Widget/Password.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget/Password.php b/api/src/Etemplate/Widget/Password.php index 2643c803fa..fc13216882 100644 --- a/api/src/Etemplate/Widget/Password.php +++ b/api/src/Etemplate/Widget/Password.php @@ -93,12 +93,12 @@ class Password extends Etemplate\Widget\Textbox { $value = $preserv; } - else if (!$plaintext && $preserv && $value_in == Credentials::decrypt(array('cred_password' => $preserv,'cred_pw_enc' => Credentials::SYSTEM_AES))) + else if ($value_in && !$plaintext && $preserv && $value_in == Credentials::decrypt(array('cred_password' => $preserv,'cred_pw_enc' => Credentials::SYSTEM_AES))) { // Don't change if they submitted the decrypted version $value = $preserv; } - else if (!$plaintext && $value_in !== $preserv) + else if ($value_in && !$plaintext && $value_in !== $preserv) { // Store encrypted $encryption = null;