Skip to content

Commit

Permalink
Improve RTF detection
Browse files Browse the repository at this point in the history
Certain RTF files may attempt to thwart detection by having a malformed RTF header, such as **{\rt000**. Removing 0x66 will result in detecting these malformed yet valid RTFs as well.

Additional reading:
https://www.decalage.info/rtf_tricks#Trick_1:_Incomplete_RTF_Header
  • Loading branch information
bartblaze authored Dec 11, 2019
1 parent 974ce1f commit c06502c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core/lib/FileSignatures.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,8 +1008,7 @@ export const FILE_SIGNATURES = {
0: 0x7b,
1: 0x5c,
2: 0x72,
3: 0x74,
4: 0x66
3: 0x74
},
extractor: extractRTF
},
Expand Down

0 comments on commit c06502c

Please sign in to comment.