#10004: in Q encoded word ignore '=xx' when xx is not valid hex.

Bug report and fix by Thomas Guettler.
This commit is contained in:
R. David Murray 2010-10-01 15:40:20 +00:00
parent 9e88b5aeee
commit 31e984c39c
3 changed files with 10 additions and 1 deletions

View file

@ -294,4 +294,4 @@ def header_decode(s):
the high level email.header class for that functionality.
"""
s = s.replace('_', ' ')
return re.sub(r'=\w{2}', _unquote_match, s, re.ASCII)
return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, re.ASCII)