Add option to escape < in chrome.i18n.getMessage
Translations are not always under the application control and they can contain special characters. If they are used in HTML context then this can result in XSS. This change addresses it by escaping < in chrome.i18n.getMessage before substituting the placeholders (which often contain trusted HTML) if the new {escape_lt: true} option is set. This will be used by Closure Templates which generate goog.getMsg('', {}, {html: true}) which will be translated by Closure Compiler to chrome.i18n.getMessage('', {}, {escape_lt: true}) for Chrome extensions. Bug: 989413 Change-Id: I5c56af375dc443a0f6fc7ebddc038fb4a074db3c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728572 Commit-Queue: Jakub Vrana <jakubvrana@google.com> Reviewed-by:Devlin <rdevlin.cronin@chromium.org> Auto-Submit: Jakub Vrana <jakubvrana@google.com> Cr-Commit-Position: refs/heads/master@{#694683}
Showing
Please register or sign in to comment