From 40f04eb9b04663cdad953be6e421a904f772d28c Mon Sep 17 00:00:00 2001 From: Thomas Piccirello Date: Tue, 22 Jul 2025 10:22:10 -0700 Subject: [PATCH] WebUI: Fix replacement of CACHEID string The string must be in the exact format `${CACHEID}` for `WebApplication::translateDocument`. --- src/webui/www/private/scripts/client.js | 2 +- src/webui/www/private/scripts/mocha-init.js | 30 ++++++++++----------- src/webui/www/private/views/rss.html | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index 5d291b4d8..18bf05ae5 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -1736,7 +1736,7 @@ window.addEventListener("DOMContentLoaded", (event) => { const id = "downloadPage"; const contentURL = new URL("download.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", urls: urls.map(encodeURIComponent).join("|") }); new MochaUI.Window({ diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js index 688678851..976551f97 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -196,7 +196,7 @@ const initializeWindows = () => { if (urls && (urls.length > 0)) { contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", urls: urls.map(encodeURIComponent).join("|") }); } @@ -325,7 +325,7 @@ const initializeWindows = () => { globalUploadLimitFN = () => { const contentURL = new URL("speedlimit.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", hashes: "global", type: "upload", }); @@ -352,7 +352,7 @@ const initializeWindows = () => { const contentURL = new URL("speedlimit.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", hashes: hashes.join("|"), type: "upload", }); @@ -399,7 +399,7 @@ const initializeWindows = () => { const contentURL = new URL("shareratio.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", hashes: hashes.join("|"), // if all torrents have same share ratio, display that share ratio. else use the default orig: torrentsHaveSameShareRatio ? shareRatio : "" @@ -476,7 +476,7 @@ const initializeWindows = () => { globalDownloadLimitFN = () => { const contentURL = new URL("speedlimit.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", hashes: "global", type: "download", }); @@ -524,7 +524,7 @@ const initializeWindows = () => { const contentURL = new URL("speedlimit.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", hashes: hashes.join("|"), type: "download", }); @@ -708,7 +708,7 @@ const initializeWindows = () => { const contentURL = new URL("setlocation.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", hashes: hashes.join("|"), path: encodeURIComponent(torrentsTable.getRow(hashes[0]).full_data.save_path) }); @@ -739,7 +739,7 @@ const initializeWindows = () => { const contentURL = new URL("rename.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", hash: hashes[0], name: row.full_data.name }); @@ -875,7 +875,7 @@ const initializeWindows = () => { const contentURL = new URL("newcategory.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", action: "set", hashes: hashes.join("|") }); @@ -918,7 +918,7 @@ const initializeWindows = () => { createCategoryFN = () => { const contentURL = new URL("newcategory.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", action: "create" }); new MochaUI.Window({ @@ -940,7 +940,7 @@ const initializeWindows = () => { createSubcategoryFN = (category) => { const contentURL = new URL("newcategory.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", action: "createSubcategory", categoryName: `${category}/` }); @@ -963,7 +963,7 @@ const initializeWindows = () => { editCategoryFN = (category) => { const contentURL = new URL("newcategory.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", action: "edit", categoryName: category }); @@ -1027,7 +1027,7 @@ const initializeWindows = () => { const contentURL = new URL("newtag.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", action: "set", hashes: hashes.join("|") }); @@ -1076,7 +1076,7 @@ const initializeWindows = () => { createTagFN = () => { const contentURL = new URL("newtag.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", action: "create" }); new MochaUI.Window({ @@ -1131,7 +1131,7 @@ const initializeWindows = () => { const contentURL = new URL("confirmtrackerdeletion.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", host: trackerHost, urls: [...trackerMap.get(trackerHost).keys()].map(encodeURIComponent).join("|") }); diff --git a/src/webui/www/private/views/rss.html b/src/webui/www/private/views/rss.html index e733796be..147bc1132 100644 --- a/src/webui/www/private/views/rss.html +++ b/src/webui/www/private/views/rss.html @@ -799,7 +799,7 @@ const editUrl = (path, url) => { const contentURL = new URL("editfeedurl.html", window.location); contentURL.search = new URLSearchParams({ - v: CACHEID, + v: "${CACHEID}", path: path, url: url });