Etemplate: Fix password widget could not be cleared entirely

This commit is contained in:
nathangray 2020-07-03 09:25:51 -06:00
parent 9130b70347
commit ee498f703d

View File

@ -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;