Skip to content

Commit

Permalink
Fix MIME header decoding for split encoded words
Browse files Browse the repository at this point in the history
  • Loading branch information
moisseev committed Nov 22, 2024
1 parent 621e7e6 commit a3f026b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/libCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ libCommon.decodeMimeHeader = function (headerValue, window) {
return headerValue
// Unfolding
.replace(/[\r\n]+[\s]+/g, "")
// Find and decode encoded words, removing any spaces between them
// Join MIME words
.replace(/(\?==\?[^?]+\?[^?]+\?)/gi, "")
// Find and decode encoded words
.replace(/(=\?[^?]+\?[^?]+\?[^?]+\?=)(\s+)?/gi, (_, encodedWord) => decodeMimeWord(encodedWord));
};

Expand Down

0 comments on commit a3f026b

Please sign in to comment.