Skip to content

Commit

Permalink
Merge pull request #1640 from lekoala/patch-5
Browse files Browse the repository at this point in the history
decode entities in toast message
  • Loading branch information
GuySartorelli authored Feb 19, 2024
2 parents 38168fa + b35bd71 commit 5075154
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion client/src/legacy/LeftAndMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,13 @@ $.entwine('ss', function($) {
});
});

function decodeEntities(text) {
const textarea = document.createElement('textarea');
textarea.innerHTML = text;
return textarea.innerText;
}

var statusMessage = function(text, type) {
text = jQuery('<div/>').text(text).html(); // Escape HTML entities in text
text = decodeEntities(text);
jQuery.noticeAdd({text: text, type: type, stayTime: 5000, inEffect: {left: '0', opacity: 'show'}});
};

0 comments on commit 5075154

Please sign in to comment.