commit ebbbd44da5a1db56e53f3096566c6cead286108a
parent fcf8cd3a0b283c2815d1c9eda52b7be87702ba26
Author: Sean Enck <sean@ttypty.com>
Date: Mon, 9 Jun 2025 18:47:13 -0400
rework to reference URL/Password field less
Diffstat:
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/internal/kdbx/actions.go b/internal/kdbx/actions.go
@@ -222,17 +222,13 @@ func (t *Transaction) Move(src *Entity, dst string) error {
e.Values = append(e.Values, value(titleKey, dTitle))
e.Values = append(e.Values, value(modTimeKey, modTime.Format(time.RFC3339)))
for k, v := range values {
- val := v
- switch k {
- case OTPField, PasswordField, URLField:
- if strings.Contains(val, "\n") {
- return fmt.Errorf("%s can NOT be multi-line", strings.ToLower(k))
- }
- if k == OTPField {
- val = config.EnvTOTPFormat.Get(v)
- }
+ if k != NotesField && strings.Contains(v, "\n") {
+ return fmt.Errorf("%s can NOT be multi-line", strings.ToLower(k))
+ }
+ if k == OTPField {
+ v = config.EnvTOTPFormat.Get(v)
}
- e.Values = append(e.Values, protectedValue(k, val))
+ e.Values = append(e.Values, protectedValue(k, v))
}
c.alterEntities(true, dOffset, dTitle, &e)
return nil