File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Sources/FoundationEssentials/URL Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -2239,6 +2239,17 @@ extension URL {
2239
2239
var filePath = path
2240
2240
#endif
2241
2241
2242
+ #if FOUNDATION_FRAMEWORK
2243
+ // Linked-on-or-after check for apps which incorrectly pass a full
2244
+ // "file:" URL string. In the old implementation, this could work
2245
+ // rarely if the app immediately called .appendingPathComponent(_:),
2246
+ // which used to accidentally interpret a relative string starting
2247
+ // with "file:" as an absolute file URL string.
2248
+ if Self . compatibility3 && filePath. starts ( with: " file: " ) {
2249
+ filePath = String ( filePath. dropFirst ( 5 ) )
2250
+ }
2251
+ #endif
2252
+
2242
2253
let isAbsolute = URL . isAbsolute ( standardizing: & filePath)
2243
2254
2244
2255
#if !NO_FILESYSTEM
You can’t perform that action at this time.
0 commit comments