diff --git a/core/manipulate-dom.js b/core/manipulate-dom.js index 1d7d2382..d972653c 100644 --- a/core/manipulate-dom.js +++ b/core/manipulate-dom.js @@ -88,9 +88,17 @@ manipulateDOM._removeCrossOriginAndIntegrityAttr = function (details) { htmlHead = asciiDecoder.decode(evt.data, {'stream': false}); // eslint-disable-next-line no-useless-escape - charsetMatch = htmlHead.match(/"'\/]+)["'].*[>\/]/i); + charsetMatch = htmlHead.match(/"'\/]+)["'>\/]/i); + if (charsetMatch === null) { + // eslint-disable-next-line no-useless-escape + charsetMatch = htmlHead.match(/"'\/]+)["'].*[>\/]/i); + } - charset = charsetMatch ? charsetMatch[1] : 'UTF-8'; + if (EncodingTypes[charsetMatch[1].toLowerCase()] !== undefined) { + charset = charsetMatch[1]; + } else { + charset = 'UTF-8'; + } } decoder = new TextDecoder(charset); } diff --git a/pages/updates/updates.html b/pages/updates/updates.html index a7bb98ae..3b979686 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -40,6 +40,7 @@
  • Updated: Vue v3.0.5 -> v3.0.6 (#290)
  • Added: vue-i18n v9.0.0 (#291)
  • Updated: angular.js v1.7.9 -> v1.8.2 (#292)
  • +
  • Fixed: Charset detection in HTML filter improved and check if supported (#293)