mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-09-25 13:50:47 +02:00
Update Ghostgram features
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import Foundation
|
||||
|
||||
public func sgActionRequestHandlerSanitizer(_ url: URL) -> URL {
|
||||
var url = url
|
||||
if let scheme = url.scheme {
|
||||
let openInPrefix = "\(scheme)://parseurl?url="
|
||||
let urlString = url.absoluteString
|
||||
if urlString.hasPrefix(openInPrefix) {
|
||||
if let unwrappedUrlString = String(urlString.dropFirst(openInPrefix.count)).removingPercentEncoding, let newUrl = URL(string: unwrappedUrlString) {
|
||||
url = newUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
return url
|
||||
}
|
||||
Reference in New Issue
Block a user