diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 16:43:49 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 16:43:49 +0000 |
commit | d36519b5068d92f4e71b8d6fd51eda2c42e54e38 (patch) | |
tree | 6aaf53187b1a36cc1d1f45c8f5ca994d55900650 /net | |
parent | c66cd7d3bfe3b572c7824db8c7d8d5c71cd21afd (diff) | |
download | chromium_src-d36519b5068d92f4e71b8d6fd51eda2c42e54e38.zip chromium_src-d36519b5068d92f4e71b8d6fd51eda2c42e54e38.tar.gz chromium_src-d36519b5068d92f4e71b8d6fd51eda2c42e54e38.tar.bz2 |
Add JSON-specific escaping, which has different rules from JS escaping.BUG=http://crbug.com/11431TEST=base_unittests.exe --gtest_filter=StringEscapeTest.Json*
Review URL: http://codereview.chromium.org/113606
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16485 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/net_util.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc index e5c53eb..c309653 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -824,7 +824,7 @@ std::string GetDirectoryListingHeader(const std::string& title) { std::string result(header.data(), header.size()); result.append("<script>start("); - string_escape::JavascriptDoubleQuote(title, true, &result); + string_escape::JsonDoubleQuote(title, true, &result); result.append(");</script>\n"); return result; @@ -836,17 +836,16 @@ std::string GetDirectoryListingEntry(const std::string& name, const Time& modified) { std::string result; result.append("<script>addRow("); - string_escape::JavascriptDoubleQuote(name, true, &result); + string_escape::JsonDoubleQuote(name, true, &result); result.append(","); - string_escape::JavascriptDoubleQuote( - EscapePath(name), true, &result); + string_escape::JsonDoubleQuote(EscapePath(name), true, &result); if (is_dir) { result.append(",1,"); } else { result.append(",0,"); } - string_escape::JavascriptDoubleQuote( + string_escape::JsonDoubleQuote( WideToUTF16Hack(FormatBytes(size, GetByteDisplayUnits(size), true)), true, &result); @@ -857,7 +856,7 @@ std::string GetDirectoryListingEntry(const std::string& name, if (!modified.is_null()) { modified_str = WideToUTF16Hack(base::TimeFormatShortDateAndTime(modified)); } - string_escape::JavascriptDoubleQuote(modified_str, true, &result); + string_escape::JsonDoubleQuote(modified_str, true, &result); result.append(");</script>\n"); |