Skip to content

Commit

Permalink
Fix code scanning alert no. 18: DOM text reinterpreted as HTML
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
km719 and github-advanced-security[bot] authored Dec 19, 2024
1 parent 3bd45ac commit 786eddf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/js/slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
/* global window, document, define, jQuery, setInterval, clearInterval */
import DOMPurify from 'dompurify';
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
Expand Down Expand Up @@ -1459,7 +1460,7 @@
$('img[data-lazy]', imagesScope).each(function () {

var image = $(this),
imageSource = $(this).attr('data-lazy'),
imageSource = DOMPurify.sanitize($(this).attr('data-lazy')),
imageToLoad = document.createElement('img');

imageToLoad.onload = function () {
Expand Down

0 comments on commit 786eddf

Please sign in to comment.