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

Unified Diff: chrome/browser/notifications/desktop_notification_service.cc

Issue 386035: Escape javascript going into text notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « no previous file | chrome/browser/notifications/desktop_notifications_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/desktop_notification_service.cc
===================================================================
--- chrome/browser/notifications/desktop_notification_service.cc (revision 31911)
+++ chrome/browser/notifications/desktop_notification_service.cc (working copy)
@@ -32,6 +32,7 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
+#include "net/base/escape.h"
#include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h"
using WebKit::WebNotificationPresenter;
@@ -56,8 +57,8 @@
else
subst.push_back(EmptyString16());
- subst.push_back(title);
- subst.push_back(body);
+ subst.push_back(UTF8ToUTF16(EscapeForHTML(UTF16ToUTF8(title))));
+ subst.push_back(UTF8ToUTF16(EscapeForHTML(UTF16ToUTF8(body))));
if (icon_url.is_valid()) {
subst.push_back(ASCIIToUTF16("block"));
« no previous file with comments | « no previous file | chrome/browser/notifications/desktop_notifications_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698