Commit 4e09d5c6 authored by Barry Warsaw's avatar Barry Warsaw

unquote(): Didn't properly de-backslash-ify. This patch (adapted from

Quinn Dunkan's mimelib SF patch #573204) fixes the problem.
parent bc6edac8
......@@ -477,9 +477,9 @@ class Message:
def unquote(str):
"""Remove quotes from a string."""
if len(str) > 1:
if str[0] == '"' and str[-1:] == '"':
return str[1:-1]
if str[0] == '<' and str[-1:] == '>':
if str.startswith('"') and str.endswith('"'):
return str[1:-1].replace('\\\\', '\\').replace('\\"', '"')
if str.startswith('<') and str.endswith('>'):
return str[1:-1]
return str
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment