Skip to content

Commit

Permalink
Fix some valid URLs being detected as invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
Hector Godoy committed Nov 13, 2023
1 parent be39b91 commit 9d36d37
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.hegocre.nextcloudpasswords.utils

import android.webkit.URLUtil

fun String.isValidEmail(): Boolean {
return if (this.isBlank()) {
true
Expand All @@ -12,6 +14,6 @@ fun String.isValidURL(): Boolean {
return if (this.isBlank()) {
true
} else {
android.util.Patterns.WEB_URL.matcher(this).matches()
URLUtil.isValidUrl(this) || URLUtil.isValidUrl("http://${this}")
}
}

0 comments on commit 9d36d37

Please sign in to comment.