From 91527a186c456923a92404412ed9888e23b874b6 Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 25 May 2020 06:19:17 +0200 Subject: [PATCH] Improved charset detection in HTML source code --- core/manipulate-dom.js | 5 +---- pages/updates/updates.html | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/manipulate-dom.js b/core/manipulate-dom.js index 0935cc3e..b2aee8df 100644 --- a/core/manipulate-dom.js +++ b/core/manipulate-dom.js @@ -64,10 +64,7 @@ manipulateDOM._removeCrossOriginAndIntegrityAttr = function (details) { if (!charset) { //content-type has no charset declared let htmlHead = asciiDecoder.decode(evt.data, {stream: false}); - let charsetMatch = htmlHead.match(/"'\/]+)["'>\/]/i); - if (!charsetMatch) { - charsetMatch = htmlHead.match(/"'\/]+)["'>\/]/i); - } + let charsetMatch = htmlHead.match(/"'\/]+)["'].*[>\/]/i); charset = charsetMatch ? charsetMatch[1] : "UTF-8"; } decoder = new TextDecoder(charset); diff --git a/pages/updates/updates.html b/pages/updates/updates.html index e3da00fb..f1bc47d8 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -23,7 +23,7 @@ New in LocalCDN:
    -
  • +
  • Improved charset detection in HTML source code
Please update your uBlock/uMatrix rules