Fixed downloaded filenames containing percent-encoded characters.
Servers set the download filename in a URL syntax (either through the Content-Disposition header, or in the filename of the requested URL itself). Previously, characters would remain percent-encoded when saved to disk, if they are deemed unsuitable for display. This criteria makes no sense for setting a filename. Cases included: - Control characters. - Path separators. - Special URL characters such as '%', '+', '&' and '#'. - Spoofing characters, such as invisible characters. Now, all characters are unescaped. Characters that are illegal in filenames (such as control characters, path separators, colons, etc) are converted into underscores. Other characters are left bare. Fixed and added tests. Bug: 849794 Change-Id: I797ee3d6aa8b803d9a7227e821fd8b4d55d0c58d Reviewed-on: https://chromium-review.googlesource.com/1209003Reviewed-by:Matt Menke <mmenke@chromium.org> Commit-Queue: Matt Giuca <mgiuca@chromium.org> Cr-Commit-Position: refs/heads/master@{#589386}
Showing
Please register or sign in to comment