From 3a58d906985b4e1034aa83dbaee0282a7605d2ee Mon Sep 17 00:00:00 2001 From: TonyRL Date: Fri, 24 May 2024 08:12:02 +0000 Subject: [PATCH] fix(template): remove undefined character and 0 width space fix #8760 --- lib/middleware/template.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/middleware/template.tsx b/lib/middleware/template.tsx index c89d02c4d..65dbfa65f 100644 --- a/lib/middleware/template.tsx +++ b/lib/middleware/template.tsx @@ -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') {