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

Unified Diff: chrome/browser/resources/options/managed_user_create_confirm.js

Issue 17155020: Fix some timing and display issues with the supervised-user confirmation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Re-uploading because Rietveld. Created 7 years, 6 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: chrome/browser/resources/options/managed_user_create_confirm.js
===================================================================
--- chrome/browser/resources/options/managed_user_create_confirm.js (revision 207949)
+++ chrome/browser/resources/options/managed_user_create_confirm.js (working copy)
@@ -52,21 +52,34 @@
* @param {Object} info An object of the form:
* info = {
* name: "Profile Name",
- * filePath: "/path/to/profile/data/on/disk"
+ * filePath: "/path/to/profile/data/on/disk",
* isManaged: (true|false)
+ * custodianEmail: "example@gmail.com"
* };
* @private
*/
setProfileInfo_: function(info) {
+ function HTMLEscape(original) {
+ return original.replace(/&/g, '&')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/"/g, '&quot;')
+ .replace(/'/g, '&#39;');
+ }
+
this.profileInfo_ = info;
$('managed-user-created-title').textContent =
loadTimeData.getStringF('managedUserCreatedTitle', info.name);
- $('managed-user-created-text').textContent =
- loadTimeData.getStringF('managedUserCreatedText',
- info.name,
- loadTimeData.getString('custodianEmail'));
$('managed-user-created-switch').textContent =
loadTimeData.getStringF('managedUserCreatedSwitch', info.name);
+
+ // HTML-escape the user-supplied strings before putting them into
+ // innerHTML. This is probably excessive for the email address, but
+ // belt-and-suspenders is cheap here.
+ $('managed-user-created-text').innerHTML =
+ loadTimeData.getStringF('managedUserCreatedText',
+ HTMLEscape(info.name),
+ HTMLEscape(info.custodianEmail));
},
};
« no previous file with comments | « chrome/browser/resources/options/manage_profile_overlay.js ('k') | chrome/browser/ui/webui/options/manage_profile_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698