diff --git a/src/webui/www/private/rename.html b/src/webui/www/private/rename.html
index c530e313c..1284812db 100644
--- a/src/webui/www/private/rename.html
+++ b/src/webui/www/private/rename.html
@@ -65,7 +65,7 @@
QBT_TR(New name)QBT_TR[CONTEXT=TransferListWidget]:
-
+
diff --git a/src/webui/www/private/scripts/misc.js b/src/webui/www/private/scripts/misc.js
index 8783fba69..d456648b4 100644
--- a/src/webui/www/private/scripts/misc.js
+++ b/src/webui/www/private/scripts/misc.js
@@ -169,7 +169,9 @@ window.qBittorrent.Misc = (function() {
const escapeHtml = function(str) {
const div = document.createElement('div');
div.appendChild(document.createTextNode(str));
- return div.innerHTML;
+ const escapedString = div.innerHTML;
+ div.remove();
+ return escapedString;
}
const safeTrim = function(value) {
diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js
index 2576673ab..e16b78efa 100644
--- a/src/webui/www/private/scripts/mocha-init.js
+++ b/src/webui/www/private/scripts/mocha-init.js
@@ -487,9 +487,9 @@ 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: false,
+ resizable: true,
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
@@ -511,11 +511,11 @@ const initializeWindows = function() {
loadMethod: 'iframe',
contentURL: new URI("rename.html").setData("hash", hash).setData("name", row.full_data.name).toString(),
scrollbars: false,
- resizable: false,
+ resizable: true,
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
- width: 250,
+ width: 400,
height: 100
});
}
@@ -532,11 +532,11 @@ const initializeWindows = function() {
loadMethod: 'iframe',
contentURL: new URI("newcategory.html").setData("action", action).setData("hashes", hashes.join('|')).toString(),
scrollbars: false,
- resizable: false,
+ resizable: true,
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
- width: 250,
+ width: 400,
height: 150
});
}
@@ -567,11 +567,11 @@ const initializeWindows = function() {
loadMethod: 'iframe',
contentURL: new URI("newcategory.html").setData("action", action).toString(),
scrollbars: false,
- resizable: false,
+ resizable: true,
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
- width: 250,
+ width: 400,
height: 150
});
updateMainData();
@@ -587,11 +587,11 @@ const initializeWindows = function() {
loadMethod: 'iframe',
contentURL: new URI('newcategory.html').setData("action", action).setData("categoryName", categoryName).setData("savePath", savePath).toString(),
scrollbars: false,
- resizable: false,
+ resizable: true,
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
- width: 250,
+ width: 400,
height: 150
});
updateMainData();
@@ -682,7 +682,7 @@ const initializeWindows = function() {
loadMethod: 'iframe',
contentURL: new URI("newtag.html").setData("action", action).setData("hashes", hashes.join("|")).toString(),
scrollbars: false,
- resizable: false,
+ resizable: true,
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
@@ -728,7 +728,7 @@ const initializeWindows = function() {
loadMethod: 'iframe',
contentURL: new URI("newtag.html").setData("action", action).toString(),
scrollbars: false,
- resizable: false,
+ resizable: true,
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
diff --git a/src/webui/www/private/setlocation.html b/src/webui/www/private/setlocation.html
index 6c7df6270..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;
}
@@ -68,8 +69,8 @@