fix(template): remove undefined character and 0 width space

fix #8760
This commit is contained in:
TonyRL 2024-05-24 08:12:02 +00:00
parent 39af963b3c
commit 3a58d90698
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
// https://stackoverflow.com/questions/1497885/remove-control-characters-from-php-string/1497928#1497928
// remove unicode control characters
// see #14940 #14943 #15262
item.description = item.description.replaceAll(/[\u0000-\u0009\u000B\u000C\u000E-\u001F\u007F]/g, '');
item.description = item.description.replaceAll(/[\u0000-\u0009\u000B\u000C\u000E-\u001F\u007F\u200B\uFFFF]/g, '');
}
if (typeof item.author === 'string') {