diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-03 19:49:08 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-03 19:49:08 +0000 |
commit | 42f50f84200a452288f11f883dcd898ababbed50 (patch) | |
tree | 2049b88492c97bdffe811d93275a9176060ce4a6 /net/base/escape.cc | |
parent | a75b2f78ceefd63f6cf9ca61f39f315239ab176c (diff) | |
download | chromium_src-42f50f84200a452288f11f883dcd898ababbed50.zip chromium_src-42f50f84200a452288f11f883dcd898ababbed50.tar.gz chromium_src-42f50f84200a452288f11f883dcd898ababbed50.tar.bz2 |
Don't unescape backslashes in URLs, since these will be converted to slashes
by googleurl, changing the meaning of the URL.
BUG=45051
TEST=none
Review URL: http://codereview.chromium.org/5603005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/escape.cc')
-rw-r--r-- | net/base/escape.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/base/escape.cc b/net/base/escape.cc index d6eef5e..5479b82 100644 --- a/net/base/escape.cc +++ b/net/base/escape.cc @@ -71,7 +71,8 @@ const std::string Escape(const std::string& text, const Charmap& charmap, // // The basic rule is that we can't unescape anything that would changing parsing // like # or ?. We also can't unescape &, =, or + since that could be part of a -// query and that could change the server's parsing of the query. +// query and that could change the server's parsing of the query. Nor can we +// unescape \ since googleurl will convert it to a /. // // Lastly, we can't unescape anything that doesn't have a canonical // representation in a URL. This means that unescaping will change the URL, and @@ -90,7 +91,7 @@ const char kUrlUnescape[128] = { // @ A B C D E F G H I J K L M N O 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // P Q R S T U V W X Y Z [ \ ] ^ _ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // ` a b c d e f g h i j k l m n o 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // p q r s t u v w x y z { | } ~ <NBSP> |