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

Unified Diff: ui/base/webui/jstemplate_builder.cc

Issue 2425663002: Add an error page for resources blocked via XSS Auditor. (Closed)
Patch Set: Created 4 years, 2 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
Index: ui/base/webui/jstemplate_builder.cc
diff --git a/ui/base/webui/jstemplate_builder.cc b/ui/base/webui/jstemplate_builder.cc
index 3e9d4110ce9f82624a2cae4e9f9d3214eecd8cd5..95e3d35cc4dfb98a9dd636d4d1bc0cbc95cf6793 100644
--- a/ui/base/webui/jstemplate_builder.cc
+++ b/ui/base/webui/jstemplate_builder.cc
@@ -27,7 +27,7 @@ void AppendJsonHtml(const base::DictionaryValue* json, std::string* output) {
// </ confuses the HTML parser because it could be a </script> tag. So we
// replace </ with <\/. The extra \ will be ignored by the JS engine.
- base::ReplaceSubstringsAfterOffset(&javascript_string, 0, "</", "<\\/");
+ base::ReplaceSubstringsAfterOffset(&javascript_string, 0, "/script", "/scr\"+\"ipt");
output->append("<script>");
output->append(javascript_string);
« content/renderer/render_frame_impl.cc ('K') | « third_party/WebKit/public/web/WebFrameClient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698