From 79542cf70c4a77af20feb8a9fad2a045931ae9f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 23 Jun 2022 13:24:04 +0200 Subject: [PATCH] Fix quota text shown escaped MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit "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 --- apps/files/js/files.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 8645719f82b..5f00ce2cb22 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -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'); -- 2.39.5