From eeed5e0fbea1862c4b3df8e8103b34edd3c28409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Thu, 23 Jun 2022 13:24:04 +0200 Subject: Fix quota text shown escaped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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(-) (limited to 'apps/files') 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'); -- cgit v1.2.3