# [PATCH 1/1] Fix recipient santitization

2 messages from 2008-03-28 to 2008-05-21. Participants: Horst H. von Brand, Junio C Hamano.
Thread: https://gitlist.dev/t/12904

## Horst H. von Brand, 2008-03-28 14:09

Subject: [PATCH 1/1] Fix recipient santitization
Message-ID: <1206713344-11244-1-git-send-email-vonbrand@inf.utfsm.cl>
URL: https://gitlist.dev/e/1206713344-11244-1-git-send-email-vonbrand%40inf.utfsm.cl

```
Need to quote all special characters, not just the first one

Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
---
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index f62f119..3bdd225 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -635,7 +635,7 @@ sub sanitize_address
 
 	# double quotes are needed if specials or CTLs are included
 	elsif ($recipient_name =~ /[][()<>@,;:\\".\000-\037\177]/) {
-		$recipient_name =~ s/(["\\\r])/\\$1/;
+		$recipient_name =~ s/(["\\\r])/\\$1/g;
 		$recipient_name = "\"$recipient_name\"";
 	}
 
-- 
1.5.5.rc2

```

## Junio C Hamano, 2008-05-21 19:38

Subject: Re: [PATCH 1/1] Fix recipient santitization
Message-ID: <7vzlqj1m8x.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzlqj1m8x.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1206713344-11244-1-git-send-email-vonbrand@inf.utfsm.cl>

```
Last night I was going through old mail-logs and found this, which I think
still is needed.  Does anybody see anything wrong with the patch (aside
from missing full-stop at the end of the sentence)?

"Horst H. von Brand" <vonbrand@inf.utfsm.cl> writes:

> Need to quote all special characters, not just the first one
>
> Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
> ---
>  git-send-email.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/git-send-email.perl b/git-send-email.perl
> index f62f119..3bdd225 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -635,7 +635,7 @@ sub sanitize_address
>  
>  	# double quotes are needed if specials or CTLs are included
>  	elsif ($recipient_name =~ /[][()<>@,;:\\".\000-\037\177]/) {
> -		$recipient_name =~ s/(["\\\r])/\\$1/;
> +		$recipient_name =~ s/(["\\\r])/\\$1/g;
>  		$recipient_name = "\"$recipient_name\"";
>  	}
>  
> -- 
> 1.5.5.rc2

```
