mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-07 04:47:14 +00:00
fix(mail): sanitise mail with ics (invitation to event)
This commit is contained in:
1 parent
6119d6cf23
commit
67ce01ec2a
2 files changed
+27
-12
No files matched your search
@@ -1031,16 +1031,26 @@ static int cssEscapingCount;
|
||||
newResult = [regex stringByReplacingMatchesInString:result options:0 range:NSMakeRange(0, [result length]) withTemplate:@"</for*"];
|
||||
result = [NSString stringWithString: newResult];
|
||||
|
||||
// Remove onload
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"onload="
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:result options:0 range:NSMakeRange(0, [result length]) withTemplate:@"onl***="];
|
||||
result = [NSString stringWithString: newResult];
|
||||
// // Remove onload
|
||||
// regex = [NSRegularExpression regularExpressionWithPattern:@"onload="
|
||||
// options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
// newResult = [regex stringByReplacingMatchesInString:result options:0 range:NSMakeRange(0, [result length]) withTemplate:@"onl***="];
|
||||
// result = [NSString stringWithString: newResult];
|
||||
|
||||
// Remove onmouseover
|
||||
regex = [NSRegularExpression regularExpressionWithPattern:@"onmouseover="
|
||||
options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
newResult = [regex stringByReplacingMatchesInString:result options:0 range:NSMakeRange(0, [result length]) withTemplate:@"onmouseo***="];
|
||||
// // Remove onmouseover
|
||||
// regex = [NSRegularExpression regularExpressionWithPattern:@"onmouseover="
|
||||
// options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
// newResult = [regex stringByReplacingMatchesInString:result options:0 range:NSMakeRange(0, [result length]) withTemplate:@"onmouseo***="];
|
||||
// result = [NSString stringWithString: newResult];
|
||||
|
||||
// regex = [NSRegularExpression regularExpressionWithPattern:@"onrepeat="
|
||||
// options: NSRegularExpressionCaseInsensitive error:&error];
|
||||
// newResult = [regex stringByReplacingMatchesInString:result options:0 range:NSMakeRange(0, [result length]) withTemplate:@"onrep***="];
|
||||
// result = [NSString stringWithString: newResult];
|
||||
|
||||
regex = [NSRegularExpression regularExpressionWithPattern: @"(on\\w+)\\s*=\\s*([\"'][^\"']*[\"']|[^\\s>]+)"
|
||||
options: NSRegularExpressionCaseInsensitive error: &error];
|
||||
newResult = [regex stringByReplacingMatchesInString: result options: 0 range: NSMakeRange(0, [result length]) withTemplate: @"on***=\"\""];
|
||||
result = [NSString stringWithString: newResult];
|
||||
|
||||
// Remove @import css (in style tags)
|
||||
|
||||
Reference in new issue
Block a user