aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/alaveteli_text_masker.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/alaveteli_text_masker.rb b/lib/alaveteli_text_masker.rb
index 5ec7aa95c..49dd15ae5 100644
--- a/lib/alaveteli_text_masker.rb
+++ b/lib/alaveteli_text_masker.rb
@@ -8,6 +8,21 @@ module AlaveteliTextMasker
'image/bmp',
'application/zip' ]
+ TextMask = [ 'text/css',
+ 'text/csv',
+ 'text/html',
+ 'text/plain',
+ 'text/rfc822-headers',
+ 'text/rtf',
+ 'text/tab-separated-values',
+ 'text/x-c',
+ 'text/x-diff',
+ 'text/x-fortran',
+ 'text/x-mail',
+ 'text/xml',
+ 'text/x-pascal',
+ 'text/x-vcard' ]
+
# Replaces all email addresses in (possibly binary) data
# Also applies custom masks and censor items
def apply_masks!(text, content_type, options = {})
@@ -19,7 +34,7 @@ module AlaveteliTextMasker
case content_type
when *DoNotBinaryMask
# do nothing
- when 'text/html'
+ when *TextMask
apply_text_masks!(text, options)
when 'application/pdf'
apply_pdf_masks!(text, options)