Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2022-06-23 14:24:04 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2022-06-23 14:24:04 +0300
commiteeed5e0fbea1862c4b3df8e8103b34edd3c28409 (patch)
tree6f906390d0fc2c57d42cfa744b87fc13c1360cd6 /apps/files
parenteb677bf048a2fd821d3397ccf33aa2b566026d7b (diff)
Fix quota text shown escaped
"t()" escapes and sanitizes the returned text by default, so strings like "<" are converted to "&lt;". However, the "jQuery.text()" parameter does not need to be escaped, as "&lt;" is shown literally as "&lt;" 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')
-rw-r--r--apps/files/js/files.js4
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');