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

Unified Diff: net/base/escape.cc

Issue 1704163003: FileURLToFilePath: Don't unescape '/' and '\\'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made comment less scary 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 | « net/base/escape.h ('k') | net/base/escape_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/escape.cc
diff --git a/net/base/escape.cc b/net/base/escape.cc
index 15de5e1dbd37d1720eec25cab678654c95c98777..fc7d5cf0fc8c4b0293b2399138ab87175c31c6f8 100644
--- a/net/base/escape.cc
+++ b/net/base/escape.cc
@@ -290,7 +290,10 @@ STR UnescapeURLWithAdjustmentsImpl(
(first_byte == ' ' && (rules & UnescapeRule::SPACES)) ||
// Allow any of the prohibited but non-control characters when
// we're doing "special" chars.
- (first_byte > ' ' && (rules & UnescapeRule::URL_SPECIAL_CHARS)) ||
+ ((first_byte == '/' || first_byte == '\\') &&
+ (rules & UnescapeRule::PATH_SEPARATORS)) ||
+ (first_byte > ' ' && first_byte != '/' && first_byte != '\\' &&
+ (rules & UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS)) ||
// Additionally allow non-display characters if requested.
(first_byte < ' ' &&
(rules & UnescapeRule::SPOOFING_AND_CONTROL_CHARS)))) {
« no previous file with comments | « net/base/escape.h ('k') | net/base/escape_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698