From f89c8df7d45cd71e081e77e8b8fbaffba8937dc2 Mon Sep 17 00:00:00 2001 From: Ahtisham Shahid Date: Mon, 20 Apr 2020 18:31:40 +0500 Subject: [PATCH] Fixes xss linter issue Fixes xss linter issue fixed eslint issue fixed eslint issue fixed eslint issue --- cms/static/js/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cms/static/js/index.js b/cms/static/js/index.js index 70def59cad..58f230e6f2 100644 --- a/cms/static/js/index.js +++ b/cms/static/js/index.js @@ -61,8 +61,9 @@ define(['domReady', 'jquery', 'underscore', 'js/utils/cancel_on_escape', 'js/vie analytics.track('Created a Course', course_info); CreateCourseUtils.create(course_info, function(errorMessage) { + var msg = edx.HtmlUtils.joinHtml(edx.HtmlUtils.HTML('

'), errorMessage, edx.HtmlUtils.HTML('

')); $('.create-course .wrap-error').addClass('is-shown'); - $('#course_creation_error').html('

' + errorMessage + '

'); + edx.HtmlUtils.setHtml($('#course_creation_error'), msg); $('.new-course-save').addClass('is-disabled').attr('aria-disabled', true); }); }; @@ -136,8 +137,9 @@ define(['domReady', 'jquery', 'underscore', 'js/utils/cancel_on_escape', 'js/vie analytics.track('Created a Library', lib_info); CreateLibraryUtils.create(lib_info, function(errorMessage) { + var msg = edx.HtmlUtils.joinHtml(edx.HtmlUtils.HTML('

'), errorMessage, edx.HtmlUtils.HTML('

')); $('.create-library .wrap-error').addClass('is-shown'); - $('#library_creation_error').html('

' + errorMessage + '

'); + edx.HtmlUtils.setHtml($('#library_creation_error'), msg); $('.new-library-save').addClass('is-disabled').attr('aria-disabled', true); }); };