From c6c25ce88b524bd9ac3da6f0e44b5dcac02f8c93 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Thu, 28 Nov 2024 10:12:44 +0100 Subject: [PATCH] Make sure device name used in core userAgent does not containt apostrophes --- Linphone/Core/CoreContext.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Linphone/Core/CoreContext.swift b/Linphone/Core/CoreContext.swift index 7b804b3af..db4e967df 100644 --- a/Linphone/Core/CoreContext.swift +++ b/Linphone/Core/CoreContext.swift @@ -138,7 +138,8 @@ final class CoreContext: ObservableObject { let appName = Bundle.main.infoDictionary?["CFBundleName"] as? String let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String - self.mCore.setUserAgent(name: "\(appName ?? "Linphone")iOS/\(version ?? "6.0.0") Beta (\(UIDevice.current.localizedModel)) LinphoneSDK", version: self.coreVersion) + let userAgent = "\(appName ?? "Linphone")iOS/\(version ?? "6.0.0") Beta (\(UIDevice.current.localizedModel.replacingOccurrences(of: "'", with: ""))) LinphoneSDK" + self.mCore.setUserAgent(name: userAgent, version: self.coreVersion) self.mCore.videoCaptureEnabled = true self.mCore.videoDisplayEnabled = true self.mCore.videoPreviewEnabled = false