Skip to content

Commit a26e58a

Browse files
authored
Merge pull request #12 from quipper/url
validate http, https before handling url
2 parents 07c5f26 + d0a6c22 commit a26e58a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Views/MessageLabel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ open class MessageLabel: UILabel {
479479
guard let date = date else { return }
480480
handleDate(date)
481481
case let .link(url):
482-
guard let url = url, UIApplication.shared.canOpenURL(url) else { return }
482+
guard let url = url, let scheme = url.scheme?.lowercased(), ["http", "https"].contains(scheme) else { return }
483483
handleURL(url)
484484
case let .transitInfoComponents(transitInformation):
485485
var transformedTransitInformation = [String: String]()

0 commit comments

Comments
 (0)