Allow IP addresses instead of strict WebDomain #767

This commit is contained in:
J-Jamet
2020-11-01 11:43:16 +01:00
parent 051ac0e669
commit 813240e233
4 changed files with 5 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ KeePassDX(2.9)
* Fix autofill #725 #551
* Fix subdomain search #728
* Fix backup search #759
* Small fixes and translations #732 #736 #737 #738 #742
* Small fixes and translations #732 #736 #737 #738 #742 #767
KeePassDX(2.8.7)
* Downgrade to Android API 29 (crash on startup with API 30 on some devices)

View File

@@ -20,6 +20,7 @@ class SearchInfo : ObjectNameResource, Parcelable {
field = when {
value == null -> null
Regex(WEB_DOMAIN_REGEX).matches(value) -> value
Regex(WEB_IP_REGEX).matches(value) -> value
else -> null
}
}
@@ -91,6 +92,7 @@ class SearchInfo : ObjectNameResource, Parcelable {
// https://gist.github.com/rishabhmhjn/8663966
const val APPLICATION_ID_REGEX = "^(?:[a-zA-Z]+(?:\\d*[a-zA-Z_]*)*)(?:\\.[a-zA-Z]+(?:\\d*[a-zA-Z_]*)*)+\$"
const val WEB_DOMAIN_REGEX = "^(?!://)([a-zA-Z0-9-_]+\\.)*[a-zA-Z0-9][a-zA-Z0-9-_]+\\.[a-zA-Z]{2,11}?\$"
const val WEB_IP_REGEX = "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\$"
@JvmField
val CREATOR: Parcelable.Creator<SearchInfo> = object : Parcelable.Creator<SearchInfo> {

View File

@@ -6,4 +6,4 @@
* Fix autofill #725 #551
* Fix subdomain search #728
* Fix backup search #759
* Small fixes and translations #732 #736 #737 #738 #742
* Small fixes and translations #732 #736 #737 #738 #742 #767

View File

@@ -6,4 +6,4 @@
* Correction de l'autofill #725 #551
* Correction de la recherche de sous-domaine #728
* Correction de la recherche de backup #759
* Petites corrections et traductions #732 #736 #737 #738 #742
* Petites corrections et traductions #732 #736 #737 #738 #742 #767