mirror of
https://github.com/nextcloud/server.git
synced 2026-03-17 08:06:09 -04:00
Fix quota text shown escaped
"t()" escapes and sanitizes the returned text by default, so strings like "<" are converted to "<". However, the "jQuery.text()" parameter does not need to be escaped, as "<" is shown literally as "<" rather than "<". Now "jQuery.html()" is used instead, which "unescapes" the given text and sets it as a new text node (as the text in the parameter does not contain markup for elements, only text). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
d710831a8e
commit
9acc1ea8a1
1 changed files with 2 additions and 2 deletions
|
|
@ -105,9 +105,9 @@
|
|||
if (response.data.quota > 0) {
|
||||
$('#quota').attr('data-original-title', Math.floor(response.data.used/response.data.quota*1000)/10 + '%');
|
||||
$('#quota progress').val(response.data.usedSpacePercent);
|
||||
$('#quotatext').text(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanQuota}));
|
||||
$('#quotatext').html(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanQuota}));
|
||||
} else {
|
||||
$('#quotatext').text(t('files', '{used} used', {used: humanUsed}));
|
||||
$('#quotatext').html(t('files', '{used} used', {used: humanUsed}));
|
||||
}
|
||||
if (response.data.usedSpacePercent > 80) {
|
||||
$('#quota progress').addClass('warn');
|
||||
|
|
|
|||
Loading…
Reference in a new issue