--- parser3/src/main/untaint.C 2003/04/18 10:36:03 1.115.2.12.2.28 +++ parser3/src/main/untaint.C 2003/08/18 08:27:41 1.118 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_UNTAINT_C="$Date: 2003/04/18 10:36:03 $"; +static const char* IDENT_UNTAINT_C="$Date: 2003/08/18 08:27:41 $"; #include "pa_string.h" @@ -246,6 +246,14 @@ inline bool mail_header_char_valid_withi || c>='0' && c<='9' || strchr("!*+-/", c); } +inline bool addr_spec_soon(const char *src) { + for(char c; c=*src; src++) + if(c=='<') + return true; + else if(!(c==' ' || c=='\t')) + return false; + return false; +} /** RFC Upper case should be used for hexadecimal digits "A" through "F" @@ -364,7 +372,7 @@ StringBody String::cstr_to_string_body(L uchar c; for(const char* src=mail_ptr; c=(uchar)*src++; ) { //RFC + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'. - if(to_quoted_printable && (c==',' || c=='<')) { + if(to_quoted_printable && (c==',' || addr_spec_soon(src) || c == '"')) { email=c=='<'; to_string("?="); to_quoted_printable=false;