mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-01-22 23:40:39 +01:00
Fixed: Charset detection in HTML filter improved and check if supported (#293)
This commit is contained in:
parent
99a31411e9
commit
bbbd1a6cd7
@ -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(/<meta.*charset=["']?([^>"'\/]+)["'].*[>\/]/i);
|
||||
charsetMatch = htmlHead.match(/<meta\s+charset=["']?([^>"'\/]+)["'>\/]/i);
|
||||
if (charsetMatch === null) {
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
charsetMatch = htmlHead.match(/<meta.*charset=["']?([^>"'\/]+)["'].*[>\/]/i);
|
||||
}
|
||||
|
||||
charset = charsetMatch ? charsetMatch[1] : 'UTF-8';
|
||||
if (EncodingTypes[charsetMatch[1].toLowerCase()] !== undefined) {
|
||||
charset = charsetMatch[1];
|
||||
} else {
|
||||
charset = 'UTF-8';
|
||||
}
|
||||
}
|
||||
decoder = new TextDecoder(charset);
|
||||
}
|
||||
|
@ -40,6 +40,7 @@
|
||||
<li>Updated: Vue v3.0.5 -> v3.0.6 (<a href="https://codeberg.org/nobody/LocalCDN/issues/290">#290</a>)</li>
|
||||
<li>Added: vue-i18n v9.0.0 (<a href="https://codeberg.org/nobody/LocalCDN/issues/291">#291</a>)</li>
|
||||
<li>Updated: angular.js v1.7.9 -> v1.8.2 (<a href="https://codeberg.org/nobody/LocalCDN/issues/292">#292</a>)</li>
|
||||
<li>Fixed: Charset detection in HTML filter improved and check if supported (<a href="https://codeberg.org/nobody/LocalCDN/issues/293">#293</a>)</li>
|
||||
</ul>
|
||||
<div id="generator-section">
|
||||
<div class="topic-label">
|
||||
|
Loading…
Reference in New Issue
Block a user