diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2022-06-23 13:24:04 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2022-06-23 13:24:04 +0200 |
commit | eeed5e0fbea1862c4b3df8e8103b34edd3c28409 (patch) | |
tree | 6f906390d0fc2c57d42cfa744b87fc13c1360cd6 /apps/files/js | |
parent | eb677bf048a2fd821d3397ccf33aa2b566026d7b (diff) | |
download | nextcloud-server-eeed5e0fbea1862c4b3df8e8103b34edd3c28409.tar.gz nextcloud-server-eeed5e0fbea1862c4b3df8e8103b34edd3c28409.zip |
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>
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/files.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index ae247584682..bbc0f8fd658 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -103,9 +103,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'); |