Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Treat string in goog.ui.Bubble as plain text.
Browse files Browse the repository at this point in the history
RELNOTES[INC]: Breaking change for third parties: This will introduce double-escaping if your code passes a string with HTML code to goog.ui.Bubble. Pass SafeHtml instead.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112188347
  • Loading branch information
vrana authored and joeltine committed Jan 14, 2016
1 parent 0af8916 commit 8ae5ad8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion closure/goog/deps.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions closure/goog/ui/bubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ goog.require('goog.dom.safe');
goog.require('goog.events');
goog.require('goog.events.EventType');
goog.require('goog.html.SafeHtml');
goog.require('goog.html.legacyconversions');
goog.require('goog.math.Box');
goog.require('goog.positioning');
goog.require('goog.positioning.AbsolutePosition');
Expand All @@ -50,10 +49,9 @@ var SafeHtml = goog.html.SafeHtml;
* The Bubble provides a general purpose bubble implementation that can be
* anchored to a particular element and displayed for a period of time.
*
* @param {string|!goog.html.SafeHtml|Element} message HTML or an element
* to display inside the bubble. If possible pass a SafeHtml; string
* is supported for backwards-compatibility only and uses
* goog.html.legacyconversions.
* @param {string|!goog.html.SafeHtml|?Element} message Message or an element
* to display inside the bubble. Strings are treated as plain-text and will
* be HTML escaped.
* @param {Object=} opt_config The configuration
* for the bubble. If not specified, the default configuration will be
* used. {@see goog.ui.Bubble.defaultConfig}.
Expand All @@ -65,7 +63,7 @@ goog.ui.Bubble = function(message, opt_config, opt_domHelper) {
goog.ui.Component.call(this, opt_domHelper);

if (goog.isString(message)) {
message = goog.html.legacyconversions.safeHtmlFromString(message);
message = goog.html.SafeHtml.htmlEscape(message);
}

/**
Expand Down

0 comments on commit 8ae5ad8

Please sign in to comment.