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

Unified Diff: net/base/escape.h

Issue 1704163003: FileURLToFilePath: Don't unescape '/' and '\\'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/escape.cc » ('j') | net/base/filename_util_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/escape.h
diff --git a/net/base/escape.h b/net/base/escape.h
index c31dcf9aa2250899e76da977b168a9aafc82c596..f75d4502bc311b9a2cf24b71d53ed54241ce5b64 100644
--- a/net/base/escape.h
+++ b/net/base/escape.h
@@ -93,6 +93,12 @@ class UnescapeRule {
// interpreting as a URL and want to do as much unescaping as possible.
URL_SPECIAL_CHARS = 4,
+ // Subset of "URL_SPECIAL_CHARS" - excludes '/' and '\\'. For use with file
+ // URLs.
+ // TODO(mmenke): Should GURL unescape those two characters for file URLs?
+ // that's what FireFox and IE do.
eroman 2016/02/18 19:37:28 Worth noting the obvious, that there are compatibi
mmenke 2016/02/18 20:30:22 Actually, I'm thinking that the compatibility and
+ URL_SPECIAL_CHARS_EXCEPT_PATH_SEPERATORS = 8,
+
// Unescapes characters that can be used in spoofing attempts (such as LOCK)
// and control characters (such as BiDi control characters and %01). This
// INCLUDES NULLs. This is used for rare cases such as data: URL decoding
@@ -100,10 +106,10 @@ class UnescapeRule {
//
// DO NOT use SPOOFING_AND_CONTROL_CHARS if the URL is going to be displayed
// in the UI for security reasons.
- SPOOFING_AND_CONTROL_CHARS = 8,
+ SPOOFING_AND_CONTROL_CHARS = 16,
eroman 2016/02/18 19:37:28 optional style: I find the 1 << X notation simpler
mmenke 2016/02/18 20:30:22 SGTM, done.
// URL queries use "+" for space. This flag controls that replacement.
- REPLACE_PLUS_WITH_SPACE = 16,
+ REPLACE_PLUS_WITH_SPACE = 32,
};
};
« no previous file with comments | « no previous file | net/base/escape.cc » ('j') | net/base/filename_util_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698