summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorRemi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>2015-06-30 14:16:49 +0200
committerJunio C Hamano <gitster@pobox.com>2015-07-07 14:39:07 -0700
commit1fe9703f08cfac8bd2db7a17bb6f3a61cf20ef35 (patch)
tree1209e6b074b61ea4ed2fda43ac8b961130d87f60 /git-send-email.perl
parent8d314d7afec5adaaa8e22332e39fe84a39584653 (diff)
downloadgit-1fe9703f08cfac8bd2db7a17bb6f3a61cf20ef35.tar.gz
send-email: consider quote as delimiter instead of character
Do not consider quote inside a recipient name as character when they are not escaped. This interprets: "Jane" "Doe" <jdoe@example.com> as: "Jane Doe" <jdoe@example.com> instead of: "Jane\" \"Doe" <jdoe@example.com> Signed-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 486cb36f27..7eec5f6db5 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1003,15 +1003,17 @@ sub sanitize_address {
return $recipient;
}
+ # remove non-escaped quotes
+ $recipient_name =~ s/(^|[^\\])"/$1/g;
+
# rfc2047 is needed if a non-ascii char is included
if ($recipient_name =~ /[^[:ascii:]]/) {
- $recipient_name =~ s/^"(.*)"$/$1/;
$recipient_name = quote_rfc2047($recipient_name);
}
# double quotes are needed if specials or CTLs are included
elsif ($recipient_name =~ /[][()<>@,;:\\".\000-\037\177]/) {
- $recipient_name =~ s/(["\\\r])/\\$1/g;
+ $recipient_name =~ s/([\\\r])/\\$1/g;
$recipient_name = qq["$recipient_name"];
}