Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
send-email: consider quote as delimiter instead of character
author
Remi Lespinet
<remi.lespinet@ensimag.grenoble-inp.fr>
Tue, 30 Jun 2015 12:16:49 +0000
(14:16 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 7 Jul 2015 21:39:07 +0000
(14:39 -0700)
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>
git-send-email.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
8d314d7
)
diff --git
a/git-send-email.perl
b/git-send-email.perl
index 486cb36f27c8f35df8a5deb7b28fc0a33931f3db..7eec5f6db55564cefb0177d21d93f11edc2685ed 100755
(executable)
--- a/
git-send-email.perl
+++ b/
git-send-email.perl
@@
-1003,15
+1003,17
@@
sub sanitize_address {
return $recipient;
}
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:]]/) {
# 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 = 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"];
}
$recipient_name = qq["$recipient_name"];
}