summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Korber <philippkorber@gmail.com>2019-03-14 14:37:44 +0100
committerPhilipp Korber <philippkorber@gmail.com>2019-03-14 14:37:44 +0100
commit306b35cdf0dedae97d376acad9196ed77ea41772 (patch)
tree926de29033abf2fe7c6ad9a71177d91e309b3f64
parent5295773af11d0dcb3f60a4b3cf2be20ff44cf66c (diff)
fix(headers): Make it impossible to have "fake" encoded words.
With certain Words/Phrases it was possible to have encoded words like text as input without the library encoding them.
-rw-r--r--headers/src/header_components/word.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/headers/src/header_components/word.rs b/headers/src/header_components/word.rs
index ed8b065..84713ca 100644
--- a/headers/src/header_components/word.rs
+++ b/headers/src/header_components/word.rs
@@ -74,7 +74,7 @@ pub fn do_encode_word<'a,'b: 'a>(
let input: &str = &*word.input;
let mail_type = handle.mail_type();
handle.write_if(input, |input| {
- (!input.starts_with("=?"))
+ (!input.contains("=?"))
&& input.chars().all( |ch| is_atext( ch, mail_type ) )
}).handle_condition_failure(|handle| {