Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Issue 1704163003: FileURLToFilePath: Don't unescape '/' and '\\'. (Closed)

Created:
4 years, 10 months ago by mmenke
Modified:
4 years, 10 months ago
Reviewers:
eroman, brettw
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

FileURLToFilePath: Don't unescape '/' and '\\'. GURL leaves these escaped, and unescaping them in paths changes the meaning of the path. Added two values to the UnescapeRule enumeration: PATH_SEPARATORS and URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS. In followup CLs, I intend to replace all uses of URL_SPECIAL_CHARS, in favor of one or both the two new values, and eventually remove the value, as it's easily to use in an unsafe manner. BUG=586657 Committed: https://crrev.com/30408ae67a9f6aea074b2883ba861613f52bd246 Cr-Commit-Position: refs/heads/master@{#377013}

Patch Set 1 #

Patch Set 2 : Add test #

Total comments: 1

Patch Set 3 : Fix typo #

Total comments: 7

Patch Set 4 : Response to comments #

Patch Set 5 : Add constant, fix spelling, add test, remove smewhat tangential test added earlier #

Total comments: 3

Patch Set 6 : Made comment less scary #

Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -168 lines) Patch
M net/base/escape.h View 1 2 3 4 5 2 chunks +25 lines, -9 lines 0 comments Download
M net/base/escape.cc View 1 2 3 4 1 chunk +4 lines, -1 line 0 comments Download
M net/base/escape_unittest.cc View 1 2 3 4 2 chunks +178 lines, -157 lines 0 comments Download
M net/base/filename_util.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M net/base/filename_util_unittest.cc View 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (10 generated)
mmenke
Eric: Not really sure where else to send this. Open to ideas (Both for whom ...
4 years, 10 months ago (2016-02-17 22:59:59 UTC) #4
mmenke
Eric: I'll plan to pick this back up, re-working the enum (Split URL_SPECIAL_CHARS in two, ...
4 years, 10 months ago (2016-02-18 16:25:29 UTC) #6
eroman
lgtm https://codereview.chromium.org/1704163003/diff/40001/net/base/escape.h File net/base/escape.h (right): https://codereview.chromium.org/1704163003/diff/40001/net/base/escape.h#newcode99 net/base/escape.h:99: // that's what FireFox and IE do. Worth ...
4 years, 10 months ago (2016-02-18 19:37:28 UTC) #7
mmenke
I think we have some disagreement here, and I want to reach some consensus on ...
4 years, 10 months ago (2016-02-18 20:30:22 UTC) #8
eroman
https://codereview.chromium.org/1704163003/diff/40001/net/base/filename_util_unittest.cc File net/base/filename_util_unittest.cc (right): https://codereview.chromium.org/1704163003/diff/40001/net/base/filename_util_unittest.cc#newcode244 net/base/filename_util_unittest.cc:244: {L"C:\\foo%2f..%5cbar", "file:///C:\\foo%2f..%5cbar"}, On 2016/02/18 20:30:22, mmenke wrote: > On ...
4 years, 10 months ago (2016-02-18 21:17:22 UTC) #9
mmenke
On 2016/02/18 21:17:22, eroman wrote: > https://codereview.chromium.org/1704163003/diff/40001/net/base/filename_util_unittest.cc > File net/base/filename_util_unittest.cc (right): > > https://codereview.chromium.org/1704163003/diff/40001/net/base/filename_util_unittest.cc#newcode244 > ...
4 years, 10 months ago (2016-02-18 22:11:06 UTC) #10
mmenke
On 2016/02/18 22:11:06, mmenke wrote: > On 2016/02/18 21:17:22, eroman wrote: > > > https://codereview.chromium.org/1704163003/diff/40001/net/base/filename_util_unittest.cc ...
4 years, 10 months ago (2016-02-18 22:21:12 UTC) #11
eroman
lgtm, but for a more pro review you would want brettw :)
4 years, 10 months ago (2016-02-19 01:01:14 UTC) #12
mmenke
On 2016/02/19 01:01:14, eroman wrote: > lgtm, but for a more pro review you would ...
4 years, 10 months ago (2016-02-19 01:14:44 UTC) #13
mmenke
[+brettw]: PTAL https://codereview.chromium.org/1704163003/diff/80001/net/base/escape_unittest.cc File net/base/escape_unittest.cc (right): https://codereview.chromium.org/1704163003/diff/80001/net/base/escape_unittest.cc#newcode165 net/base/escape_unittest.cc:165: "Some%20random text %25-OK"}, Sorry for the reformatting ...
4 years, 10 months ago (2016-02-19 17:55:12 UTC) #16
brettw
lgtm https://codereview.chromium.org/1704163003/diff/80001/net/base/escape.h File net/base/escape.h (right): https://codereview.chromium.org/1704163003/diff/80001/net/base/escape.h#newcode92 net/base/escape.h:92: // should be used rarely, and only with ...
4 years, 10 months ago (2016-02-22 23:33:24 UTC) #17
mmenke
Thanks for the feedback! https://codereview.chromium.org/1704163003/diff/80001/net/base/escape.h File net/base/escape.h (right): https://codereview.chromium.org/1704163003/diff/80001/net/base/escape.h#newcode92 net/base/escape.h:92: // should be used rarely, ...
4 years, 10 months ago (2016-02-23 15:59:39 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1704163003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1704163003/100001
4 years, 10 months ago (2016-02-23 16:03:03 UTC) #21
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 10 months ago (2016-02-23 17:28:29 UTC) #23
commit-bot: I haz the power
4 years, 10 months ago (2016-02-23 17:29:18 UTC) #25
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/30408ae67a9f6aea074b2883ba861613f52bd246
Cr-Commit-Position: refs/heads/master@{#377013}

Powered by Google App Engine
This is Rietveld 408576698