Skip to content

Commit

Permalink
Migrate deprecated "escape" to "encodeURIComponent"
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Dec 24, 2024
1 parent 27442d0 commit a5d533c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions share/static/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ jQuery(function() {
if ( evt.detail.value ) {
for ( const action of evt.detail.value ) {
// Need to decode action that is UTF-8 encoded
jQuery.jGrowl(decodeURIComponent(escape(action)), { themeState: 'none' });
jQuery.jGrowl(decodeURIComponent(encodeURIComponent(action)), { themeState: 'none' });
}

const history_container = document.querySelector('.history-container');
Expand Down Expand Up @@ -854,7 +854,7 @@ jQuery(function() {
});

document.body.addEventListener('titleChanged', function(evt) {
document.title = decodeURIComponent(escape(evt.detail.value));
document.title = decodeURIComponent(encodeURIComponent(evt.detail.value));
});

document.body.addEventListener('triggerChanged', function(evt) {
Expand All @@ -865,7 +865,7 @@ jQuery(function() {
document.body.addEventListener('widgetTitleChanged', function(evt) {
const title = evt.detail.elt.closest('div.titlebox').querySelector('.titlebox-title a');
if ( title ) {
title.innerHTML = decodeURIComponent(escape(evt.detail.value));
title.innerHTML = decodeURIComponent(encodeURIComponent(evt.detail.value));
}
});

Expand Down

0 comments on commit a5d533c

Please sign in to comment.