Bug 274695 - [Cococa] Ensure temporary PDF file paths are written matching the meaning of their relevant file URLs
Summary: [Cococa] Ensure temporary PDF file paths are written matching the meaning of ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-05-24 17:26 PDT by Brent Fulgham
Modified: 2024-05-27 16:44 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2024-05-24 17:26:43 PDT
NSFileManager creates file using the exact strings provided as paths. If a file URL with percent-encoded values is passed to it, the file paths are created without decoding the paths.

For example, a file URL like "file:///tmp/some%20temp%20file.txt" will be created as the path "/tmp/some%20%temp%20file.txt", rather than "/tmp/some\ temp\ file.txt".

When a file URL is passed to NSWorkspace to open a path, the path is decoded.

This creates a mismatch, such that a request to create and then open a temporary file of "/tmp/some%20%temp%20file.txt" causes NSWorkspace to attempt to open the file "/tmp/some\ temp\ file.txt", which fails.

This patch corrects this mis-match so that temporary PDF files can open properly.
Comment 1 Brent Fulgham 2024-05-24 17:27:00 PDT
<rdar://127379128>
Comment 2 Brent Fulgham 2024-05-24 17:34:40 PDT
Pull request: https://github.com/WebKit/WebKit/pull/29099
Comment 3 EWS 2024-05-27 16:44:44 PDT
Committed 279359@main (ae3780f0dcc3): <https://commits.webkit.org/279359@main>

Reviewed commits have been landed. Closing PR #29099 and removing active labels.