Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace trustAsHTML with getTrustedHTML
Browse files Browse the repository at this point in the history
getTrustedHTML returns value that is safe for HTML context or throws an exception
ZitaNemeckova committed Aug 3, 2017
1 parent fa8fe6b commit 0bd24d6
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/assets/javascripts/components/widget-report.js
Original file line number Diff line number Diff line change
@@ -8,12 +8,11 @@ ManageIQ.angular.app.component('widgetReport', {
vm.widgetReportModel = {};
this.$onInit = function() {
$http.get('/dashboard/widget_report_data/' + vm.id)
.then(function(response) { vm.widgetReportModel.content = $sce.trustAsHtml(response.data.content);})
.then(function(response) { vm.widgetReportModel.content = $sce.getTrustedHtml(response.data.content);})
.catch(miqService.handleFailure);
vm.div_id = "dd_w" + vm.id + "_box";
};
vm.contentPresent = function() {
debugger;
return vm.widgetReportModel.content !== undefined;
};
}],
2 changes: 1 addition & 1 deletion app/controllers/dashboard_controller.rb
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ def start_url

def widget_report_data
widget = MiqWidget.find(params[:id])
render :json => {:content => widget.contents_for_user(current_user).contents.html_safe}
render :json => {:content => widget.contents_for_user(current_user).contents}
end

def show

0 comments on commit 0bd24d6

Please sign in to comment.