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

This commit is contained in:
nobody 2023-09-07 06:06:25 +02:00
parent 55fefd12b9
commit d8d48265d5
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
2 changed files with 4 additions and 4 deletions

View File

@ -86,8 +86,8 @@ manipulateDOM._removeCrossOriginAndIntegrityAttr = function (details) {
charsetMatch = htmlHead.match(/<meta.*charset=["']?([^>"'\/]+)["'].*[>\/]/i) || 'utf8'; charsetMatch = htmlHead.match(/<meta.*charset=["']?([^>"'\/]+)["'].*[>\/]/i) || 'utf8';
} }
if (EncodingTypes[charsetMatch[1].toLowerCase()] !== undefined) { if (EncodingTypes[charsetMatch[1].toLowerCase().trim()] !== undefined) {
charset = charsetMatch[1]; charset = charsetMatch[1].trim();
} else { } else {
// If charset is unclear, then use ASCII by default. // If charset is unclear, then use ASCII by default.
// Other charsets are mostly tagged in the header or HTML source code. // Other charsets are mostly tagged in the header or HTML source code.

View File

@ -25,9 +25,9 @@
<h2>New in LocalCDN:</h2> <h2>New in LocalCDN:</h2>
</div> </div>
<div class="release-notes-area"> <div class="release-notes-area">
<p></p> <p>Fixed</p>
<ul> <ul>
<li></li> <li>HTML filter trim spaces in character set detection (<a href="https://codeberg.org/nobody/LocalCDN/issues/1526">#1526</a>)</li>
</ul> </ul>
</div> </div>
<div id="generator-section"> <div id="generator-section">