Skip to content

Commit

Permalink
fix(template): remove undefined character and 0 width space
Browse files Browse the repository at this point in the history
fix #8760
  • Loading branch information
TonyRL committed May 24, 2024
1 parent 39af963 commit 3a58d90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/middleware/template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 3a58d90

Please sign in to comment.