chore: cherry-pick 54e32332750c from chromium #35273
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Merge 104] Sanitize default file name in windows select file dialog
On windows, '%' is a special character and can be used for environment
variables. So if the default file name is '%DATADIR%', it can actually
refer to another directory and thus causing weird behaviors.
And '%' cannot be escaped when used in the file dialog. Both "^%" and
"%%" don't work. This CL mitigates the issue by replacing '%' with '_'.
This only affects the default file name when showing the dialog. Power
users can still change the file name by adding '%' if needed.
BUG=1308422
(cherry picked from commit 9cdce354cb3b0da5b4b311638973d407be7712b6)
Change-Id: Ibb275f5c3c2c9458c20d1e97ad527f7c95184eaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3688608
Reviewed-by: Robert Liao robliao@chromium.org
Commit-Queue: Min Qin qinmin@chromium.org
Cr-Original-Commit-Position: refs/heads/main@{#1014602}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3758469
Cr-Commit-Position: refs/branch-heads/5112@{#822}
Cr-Branched-From: b13d3fe7b3c47a56354ef54b221008afa754412e-refs/heads/main@{#1012729}
Notes: Security: backported fix for CVE-2022-2618.