mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-25 09:54:22 +00:00
core, ui: safe mode to sanitize URIs when sending (#6196)
* core: safe mode to sanitize URIs when sending * ui: use safe sanitize when sending
This commit is contained in:
@@ -186,9 +186,9 @@ struct ParsedServerAddress: Decodable {
|
||||
var parseError: String
|
||||
}
|
||||
|
||||
public func parseSanitizeUri(_ s: String) -> ParsedUri? {
|
||||
public func parseSanitizeUri(_ s: String, safe: Bool) -> ParsedUri? {
|
||||
var c = s.cString(using: .utf8)!
|
||||
if let cjson = chat_parse_uri(&c) {
|
||||
if let cjson = chat_parse_uri(&c, safe ? 1 : 0) {
|
||||
if let d = dataFromCString(cjson) {
|
||||
do {
|
||||
return try jsonDecoder.decode(ParsedUri.self, from: d)
|
||||
|
||||
Reference in New Issue
Block a user