mirror of
https://github.com/google/nomulus
synced 2026-01-07 22:15:30 +00:00
Use goog.dom.safeHtmlToNode instead of deprecated htmlToDocumentFragment.
goog.dom.htmlToDocumentFragment is going to be removed in [] It is removed because its usage can cause XSS.
More information: []
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=116081948
This commit is contained in:
committed by
Justine Tunney
parent
0ef0c933d2
commit
1ecf3db5fc
@@ -21,6 +21,7 @@ goog.require('goog.dom.classlist');
|
||||
goog.require('goog.dom.xml');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('goog.format.JsonPrettyPrinter');
|
||||
goog.require('goog.html.legacyconversions');
|
||||
goog.require('goog.json');
|
||||
goog.require('goog.testing.asserts');
|
||||
goog.require('goog.testing.events');
|
||||
@@ -34,7 +35,8 @@ goog.require('goog.testing.net.XhrIo');
|
||||
*/
|
||||
registry.testing.addToDocument = function(html) {
|
||||
goog.global.document.body.appendChild(
|
||||
goog.dom.htmlToDocumentFragment(html));
|
||||
goog.dom.safeHtmlToNode(
|
||||
goog.html.legacyconversions.safeHtmlFromString(html)));
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user