diff --git a/src/keepass2android/EntryEditActivity.cs b/src/keepass2android/EntryEditActivity.cs index f55b3bc9..68fb3beb 100644 --- a/src/keepass2android/EntryEditActivity.cs +++ b/src/keepass2android/EntryEditActivity.cs @@ -1015,6 +1015,7 @@ namespace keepass2android LinearLayout container = (LinearLayout) FindViewById(Resource.Id.advanced_container); + HashSet allKeys = new HashSet(); for (int i = 0; i < container.ChildCount; i++) { View ees = container.GetChildAt(i); @@ -1025,7 +1026,15 @@ namespace keepass2android Toast.MakeText(this, Resource.String.error_string_key, ToastLength.Long).Show(); return false; } - + + if (allKeys.Contains(key)) + { + Toast.MakeText(this, GetString(Resource.String.error_string_duplicate_key, new Java.Lang.Object[]{key}), ToastLength.Long).Show(); + return false; + } + + allKeys.Add(key); + } return true; diff --git a/src/keepass2android/Resources/values/strings.xml b/src/keepass2android/Resources/values/strings.xml index 488e1891..f5eea0cf 100644 --- a/src/keepass2android/Resources/values/strings.xml +++ b/src/keepass2android/Resources/values/strings.xml @@ -277,6 +277,7 @@ Invalid date/time format for expiry date! A field name is required for each string. + A field name cannot be used twice (%1$s). Field Name Field value Protected field