RTFHandler: protect against CR and bad hexadecimal sequence

In RTF is possible to specify characters with the sequence \'XX being
XX an hexadecimal number.
With this changeset we guard against incorrect hexadecimal numbers which
will be ignored.

The other change added is to ignore carriadge returns in plain text.
This commit is contained in:
Javier Amor García
2016-02-01 16:55:20 +01:00
parent 8e80b57d31
commit e5f15f69df
3 changed files with 28 additions and 5 deletions
File diff suppressed because one or more lines are too long
+9
View File
@@ -306,4 +306,13 @@
againstExpectedHTML: expected];
}
- (void) test_bad_hex_and_cr
{
NSString *file =@"bad_hex_and_cr.rtf";
NSString *expected=@"<html><meta charset='utf-8'><body><font face=\"Calibri\"><font face=\"Calibri Cyr\"><font color=\"#000000\">Good hex:H Bad1Hex: Bad2Hex: Ignored Carriadge Return</font></font></font></body></html>";
[self checkHTMLConversionOfRTFFile: file
againstExpectedHTML: expected];
}
@end