mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 04:47:44 -02:30
fixing xss bugs
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('Utilities', ['RestServices', 'Utilities'])
|
angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ngdoc method
|
* @ngdoc method
|
||||||
@@ -99,9 +99,10 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
|
|||||||
* alert-info...). Pass an optional function(){}, if you want a specific action to occur when user
|
* alert-info...). Pass an optional function(){}, if you want a specific action to occur when user
|
||||||
* clicks 'OK' button. Set secondAlert to true, when a second dialog is needed.
|
* clicks 'OK' button. Set secondAlert to true, when a second dialog is needed.
|
||||||
*/
|
*/
|
||||||
.factory('Alert', ['$rootScope', function ($rootScope) {
|
.factory('Alert', ['$rootScope', '$filter', function ($rootScope, $filter) {
|
||||||
return function (hdr, msg, cls, action, secondAlert, disableButtons, backdrop) {
|
return function (hdr, msg, cls, action, secondAlert, disableButtons, backdrop) {
|
||||||
var scope = $rootScope.$new(), alertClass, local_backdrop;
|
var scope = $rootScope.$new(), alertClass, local_backdrop;
|
||||||
|
msg = $filter('sanitize')(msg);
|
||||||
if (secondAlert) {
|
if (secondAlert) {
|
||||||
|
|
||||||
$('#alertHeader2').html(hdr);
|
$('#alertHeader2').html(hdr);
|
||||||
|
|||||||
@@ -27,16 +27,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export default
|
export default
|
||||||
angular.module('PromptDialog', ['Utilities'])
|
angular.module('PromptDialog', ['Utilities', 'sanitizeFilter'])
|
||||||
.factory('Prompt', ['$sce',
|
.factory('Prompt', ['$sce', '$filter',
|
||||||
function ($sce) {
|
function ($sce, $filter) {
|
||||||
return function (params) {
|
return function (params) {
|
||||||
|
|
||||||
var dialog = angular.element(document.getElementById('prompt-modal')),
|
var dialog = angular.element(document.getElementById('prompt-modal')),
|
||||||
scope = dialog.scope(), cls, local_backdrop;
|
scope = dialog.scope(), cls, local_backdrop;
|
||||||
|
|
||||||
scope.promptHeader = params.hdr;
|
scope.promptHeader = params.hdr;
|
||||||
scope.promptBody = $sce.trustAsHtml(params.body);
|
scope.promptBody = $filter('sanitize')(params.body);
|
||||||
scope.promptAction = params.action;
|
scope.promptAction = params.action;
|
||||||
|
|
||||||
local_backdrop = (params.backdrop === undefined) ? "static" : params.backdrop;
|
local_backdrop = (params.backdrop === undefined) ? "static" : params.backdrop;
|
||||||
|
|||||||
Reference in New Issue
Block a user