Don't add https:// prefix to empty website urls
This commit is contained in:
1 parent
ba1c2cd2b9
commit
8a473885c7
1 file changed
+3
@@ -98,6 +98,9 @@ struct Profile: Codable {
|
||||
}
|
||||
|
||||
var website_url: URL? {
|
||||
if self.website?.trimmingCharacters(in: .whitespacesAndNewlines) == "" {
|
||||
return nil
|
||||
}
|
||||
return self.website.flatMap { url in
|
||||
let trim = url.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
if !(trim.hasPrefix("http://") || trim.hasPrefix("https://")) {
|
||||
|
||||
Reference in new issue
Block a user