summaryrefslogtreecommitdiffstats
path: root/net/base/escape.h
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-29 16:36:36 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-29 16:36:36 +0000
commita9c217fc61aaa2aff80877836264528cf9870ae8 (patch)
tree09485ea0a3134b2efbfce170f73b063447ed473a /net/base/escape.h
parent4e1fd027999bf8148458d5c14ac6345d79227cfd (diff)
downloadchromium_src-a9c217fc61aaa2aff80877836264528cf9870ae8.zip
chromium_src-a9c217fc61aaa2aff80877836264528cf9870ae8.tar.gz
chromium_src-a9c217fc61aaa2aff80877836264528cf9870ae8.tar.bz2
Puts back the optional unescaping of control characters and URL parse-affecting characters. That patch was reverted due to build problems.
This is heavily modified from the original patch. That patch required an additional function and a bunch of internal boolean flags. This one uses the new flags enum I wrote to add this to the existing functionality more cleanly. BUG=1271340 BUG=1258819 Review URL: http://chrome-reviews.prom.corp.google.com/804 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/escape.h')
-rw-r--r--net/base/escape.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/net/base/escape.h b/net/base/escape.h
index 220eebc..4b86a64 100644
--- a/net/base/escape.h
+++ b/net/base/escape.h
@@ -77,17 +77,20 @@ class UnescapeRule {
// by other applications.
SPACES = 1,
- // Unescapes "%25" to "%". This must not be used when the resulting string
- // will need to be interpreted as a URL again, since we won't know what
- // should be escaped and what shouldn't. For example, "%2520" would be
- // converted to "%20" which would have different meaning than the origina.
- // This flag is used when generating final output like filenames for URLs
- // where we won't be interpreting as a URL and want to do as much unescaping
- // as possible.
- PERCENTS = 2,
+ // Unescapes various characters that will change the meaning of URLs,
+ // including '%', '+', '&', '/', '#'. If we unescaped these charaters, the
+ // resulting URL won't be the same as the source one. This flag is used when
+ // generating final output like filenames for URLs where we won't be
+ // interpreting as a URL and want to do as much unescaping as possible.
+ URL_SPECIAL_CHARS = 2,
+
+ // Unescapes control characters such as %01. This INCLUDES NULLs!. This is
+ // used for rare cases such as data: URL decoding where the result is binary
+ // data. You should not use this for normal URLs!
+ CONTROL_CHARS = 4,
// URL queries use "+" for space. This flag controls that replacement.
- REPLACE_PLUS_WITH_SPACE = 4,
+ REPLACE_PLUS_WITH_SPACE = 8,
};
};