[ios] Fixed crash on urls with spaces #621

Merged
biodranik merged 1 commit from ios/deeplink-space-crash-fix into master 2021-06-18 12:02:07 +00:00

View file

@ -28,7 +28,9 @@
func applicationDidReceiveUniversalLink(_ universalLink: URL) -> Bool {
// Convert http(s)://omaps.app/ENCODEDCOORDS/NAME to om://ENCODEDCOORDS/NAME
self.url = URL(string: String(format: "om:/%@", universalLink.path))
self.url = URL(string: universalLink.absoluteString
.replacingOccurrences(of: "http://omaps.app", with: "om:/")
.replacingOccurrences(of: "https://omaps.app", with: "om:/"))
return handleDeepLink(url: self.url!)
vng commented 2021-06-18 11:24:11 +00:00 (Migrated from github.com)
Review

А давай сделаем безопасно и проверим тут self.url ?
Нам подсунут говноссылку и мы так будем падать

А давай сделаем безопасно и проверим тут self.url ? Нам подсунут говноссылку и мы так будем падать
vng commented 2021-06-18 11:41:52 +00:00 (Migrated from github.com)
Review

Ок, в принципе если входной URL валидный, то тут тоже будет ок.

Ок, в принципе если входной URL валидный, то тут тоже будет ок.
}