mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
Use proper method for manipulating text
`innerText` is too powerful for the job here, use a more restricted/secure way to manipulate text. Related: #17211. PR #17212.
This commit is contained in:
@@ -48,11 +48,11 @@ function submitLoginForm() {
|
||||
if ((xhr.status === 200) && (xhr.responseText === "Ok."))
|
||||
location.reload(true);
|
||||
else
|
||||
errorMsgElement.innerHTML = 'QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]';
|
||||
errorMsgElement.textContent = 'QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]';
|
||||
}
|
||||
});
|
||||
xhr.addEventListener('error', function() {
|
||||
errorMsgElement.innerHTML = (xhr.responseText !== "")
|
||||
errorMsgElement.textContent = (xhr.responseText !== "")
|
||||
? xhr.responseText
|
||||
: 'QBT_TR(Unable to log in, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user