mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-05-02 14:36:08 -04:00
Partial revert "Do not double-encode HTML in i18n", only revert the removal of required encoding logic - still has to be moved
This reverts commit 01414e43ca
.
This commit is contained in:
parent
76eff6a87a
commit
cec5cb41d7
3 changed files with 9 additions and 3 deletions
|
@ -614,8 +614,14 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
args[0] = translations[messageId];
|
||||
}
|
||||
|
||||
// messageID may contain links, but only the first parameter, as that is from a trusted source (code or translation JSON files)
|
||||
// messageID may contain links, but should be from a trusted source (code or translation JSON files)
|
||||
let containsLinks = args[0].indexOf('<a') !== -1;
|
||||
for (let i = 0; i < args.length; ++i) {
|
||||
// parameters (i > 0) may never contain HTML as they may come from untrusted parties
|
||||
if (i > 0 || containsNoLinks) {
|
||||
args[i] = Helper.htmlEntities(args[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// format string
|
||||
let output = Helper.sprintf.apply(this, args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue