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:
Evgeny
2025-08-18 12:58:10 +01:00
committed by GitHub
parent 28a0959d96
commit dc3dcd4fc8
13 changed files with 80 additions and 48 deletions
+2 -2
View File
@@ -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)