mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
WebUI: show correct location path
The `path` might contains '&' (delimit character) so it must be encoded. Closes #15976.
This commit is contained in:
parent
08f3630f01
commit
0d334369f0
@ -487,7 +487,7 @@ const initializeWindows = function() {
|
|||||||
id: 'setLocationPage',
|
id: 'setLocationPage',
|
||||||
title: "QBT_TR(Set location)QBT_TR[CONTEXT=TransferListWidget]",
|
title: "QBT_TR(Set location)QBT_TR[CONTEXT=TransferListWidget]",
|
||||||
loadMethod: 'iframe',
|
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,
|
scrollbars: false,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
maximizable: false,
|
maximizable: false,
|
||||||
|
@ -31,16 +31,17 @@
|
|||||||
|
|
||||||
window.addEvent('domready', function() {
|
window.addEvent('domready', function() {
|
||||||
const path = new URI().getData('path');
|
const path = new URI().getData('path');
|
||||||
|
|
||||||
// set text field to current value
|
// set text field to current value
|
||||||
if (path)
|
if (path)
|
||||||
$('setLocation').value = window.qBittorrent.Misc.escapeHtml(path);
|
$('setLocation').value = decodeURIComponent(path);
|
||||||
|
|
||||||
$('setLocation').focus();
|
$('setLocation').focus();
|
||||||
$('setLocationButton').addEvent('click', function(e) {
|
$('setLocationButton').addEvent('click', function(e) {
|
||||||
new Event(e).stop();
|
new Event(e).stop();
|
||||||
// check field
|
// check field
|
||||||
const location = $('setLocation').value.trim();
|
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]');
|
$('error_div').set('text', 'QBT_TR(Save path is empty)QBT_TR[CONTEXT=TorrentsController]');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user