plugins: use to explicitely trust html

This commit is contained in:
David Cormier 2013-10-13 14:33:09 -04:00
parent d3f844acb4
commit 1f7cb5c3ba
2 changed files with 5 additions and 3 deletions

View File

@ -123,8 +123,9 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
<div ng-repeat="metadata in bufferline.metadata">
<div ng-show="metadata.visible">
<a ng-click="metadata.visible = false">Hide additional content</a>
<div ng-bind-html="metadata.content"></div>
<a ng-click="metadata.visible = false">Hide additional content</a>
</div>
<div ng-hide="metadata.visible">

View File

@ -26,7 +26,7 @@ var Plugin = function(contentForMessage) {
* to display when messages are received.
*
*/
plugins.service('plugins', ['userPlugins', function(userPlugins) {
plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) {
/*
* Defines the plugin manager object
@ -57,7 +57,8 @@ plugins.service('plugins', ['userPlugins', function(userPlugins) {
var pluginContent = plugins[i].contentForMessage(message);
if (pluginContent) {
var pluginContent = {'visible': true,
'content': pluginContent }
'content': $sce.trustAsHtml(pluginContent) }
content.push(pluginContent);
if (plugins[i].exclusive) {