From d8d48265d5934cb353ced41716e5651122b06f80 Mon Sep 17 00:00:00 2001 From: nobody Date: Thu, 7 Sep 2023 06:06:25 +0200 Subject: [PATCH] HTML filter trim spaces in character set detection (#1526) --- core/manipulate-dom.js | 4 ++-- pages/updates/updates.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/manipulate-dom.js b/core/manipulate-dom.js index 870cc650..86999f63 100644 --- a/core/manipulate-dom.js +++ b/core/manipulate-dom.js @@ -86,8 +86,8 @@ manipulateDOM._removeCrossOriginAndIntegrityAttr = function (details) { charsetMatch = htmlHead.match(/"'\/]+)["'].*[>\/]/i) || 'utf8'; } - if (EncodingTypes[charsetMatch[1].toLowerCase()] !== undefined) { - charset = charsetMatch[1]; + if (EncodingTypes[charsetMatch[1].toLowerCase().trim()] !== undefined) { + charset = charsetMatch[1].trim(); } else { // If charset is unclear, then use ASCII by default. // Other charsets are mostly tagged in the header or HTML source code. diff --git a/pages/updates/updates.html b/pages/updates/updates.html index 0f57eb46..ed1e7b2b 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -25,9 +25,9 @@

New in LocalCDN:

-

+

Fixed

    -
  • +
  • HTML filter trim spaces in character set detection (#1526)