diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js index 643585b08..e16b78efa 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -487,7 +487,7 @@ const initializeWindows = function() { id: 'setLocationPage', title: "QBT_TR(Set location)QBT_TR[CONTEXT=TransferListWidget]", loadMethod: 'iframe', - contentURL: new URI("setlocation.html").setData("hashes", hashes.join('|')).setData("path", row.full_data.save_path).toString(), + contentURL: new URI("setlocation.html").setData("hashes", hashes.join('|')).setData("path", encodeURIComponent(row.full_data.save_path)).toString(), scrollbars: false, resizable: true, maximizable: false, diff --git a/src/webui/www/private/setlocation.html b/src/webui/www/private/setlocation.html index 68122fa43..36a2ee815 100644 --- a/src/webui/www/private/setlocation.html +++ b/src/webui/www/private/setlocation.html @@ -31,16 +31,17 @@ window.addEvent('domready', function() { const path = new URI().getData('path'); + // set text field to current value if (path) - $('setLocation').value = window.qBittorrent.Misc.escapeHtml(path); + $('setLocation').value = decodeURIComponent(path); $('setLocation').focus(); $('setLocationButton').addEvent('click', function(e) { new Event(e).stop(); // check field const location = $('setLocation').value.trim(); - if (location === null || location === "") { + if ((location === null) || (location === "")) { $('error_div').set('text', 'QBT_TR(Save path is empty)QBT_TR[CONTEXT=TorrentsController]'); return false; }