Skip to content

Commit

Permalink
fix(core): encode reserved HTML characters in RTF parser
Browse files Browse the repository at this point in the history
Fixes #5388
  • Loading branch information
cgx committed Mar 29, 2022
1 parent a5d18bf commit 6d50dee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions SoObjects/SOGo/RTFHandler.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2005-2013 Inverse inc.
Copyright (C) 2005-2022 Inverse inc.
This file is part of SOGo.
Expand All @@ -23,6 +23,8 @@
#include <Foundation/NSValue.h>
#include <Foundation/NSException.h>

#import <NGExtensions/NSString+misc.h>

//
// Useful macros
//
Expand Down Expand Up @@ -1456,7 +1458,7 @@ - (NSMutableData *) parse
else
active_charset = defaultCharset;

s = [NSString stringWithCharacters: &(active_charset[c]) length: 1];
s = [[NSString stringWithCharacters: &(active_charset[c]) length: 1] stringByEscapingHTMLString];
d = [s dataUsingEncoding: NSUTF8StringEncoding];
[_html appendData: d];
}
Expand Down

0 comments on commit 6d50dee

Please sign in to comment.