From 7481ccf37087c3f456d7e5a844da01d0f8883098 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Mon, 6 Nov 2023 14:04:53 +0100 Subject: [PATCH] fix(hmtl): prevent html injection of tag form --- SoObjects/SOGo/NSString+Utilities.m | 12 ++++++++++++ Tests/Unit/TestNSString+Utilities.m | 1 + 2 files changed, 13 insertions(+) diff --git a/SoObjects/SOGo/NSString+Utilities.m b/SoObjects/SOGo/NSString+Utilities.m index 682be7e71..cf722d923 100644 --- a/SoObjects/SOGo/NSString+Utilities.m +++ b/SoObjects/SOGo/NSString+Utilities.m @@ -979,6 +979,18 @@ static int cssEscapingCount; newResult = [regex stringByReplacingMatchesInString:result options:0 range:NSMakeRange(0, [result length]) withTemplate:@"bar"] stringWithoutHTMLInjection: NO], @"foobar bar"); testEquals([[NSString stringWithString:@"foobar "] stringWithoutHTMLInjection: NO], @"foobar bar"); testEquals([[NSString stringWithString:@"foobar