Commits

Cameron Simpson committed 0267503

email-add-spam-subject: quote chars in regexp using a white list - safer

Comments (0)

Files changed (1)

bin-cs/email-add-spam-subject

 eval `mhdrs -sh < "$tmpf" | sed 's/^/hdr_/'`
 subj=$hdr_SUBJECT
 [ -n "$subj" ]
-re_subj=\^$(printf "%s\n" "$subj" | sed '2,$d; s/[\[]()|$+*?\\]/\\&/g')
+re_subj=\^$(printf "%s\n" "$subj" | sed '2,$d; s/[^-A-Za-z0-9_, 	]/\\&/g')
 [ -n "$re_subj" ]
 
 ( cat "$filer"