diff --git a/Web/static/js/openvk.cls.js b/Web/static/js/openvk.cls.js index 7532a1ad..0ecc385e 100644 --- a/Web/static/js/openvk.cls.js +++ b/Web/static/js/openvk.cls.js @@ -428,6 +428,18 @@ function showIncreaseRatingDialog(coinsCount, userUrl, hash) { }; } +function escapeHtml(text) { + var map = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + return text.replace(/[&<>"']/g, function(m) { return map[m]; }); +} + $(document).on("scroll", () => { if($(document).scrollTop() > $(".sidebar").height() + 50) { $(".floating_sidebar")[0].classList.add("show"); diff --git a/Web/static/js/player.js b/Web/static/js/player.js index 8bb0f316..c1ae1919 100644 --- a/Web/static/js/player.js +++ b/Web/static/js/player.js @@ -16,6 +16,8 @@ function _bsdnToHumanTime(time) { } function _bsdnTpl(name, author) { + name = escapeHtml(name); + return `