git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH RFC] gitweb: Handle non-ASCII email addresses
@ 2021-09-15 19:26 Jan-Benedict Glaw
  2021-09-22 17:42 ` *ping* " Jan-Benedict Glaw
  0 siblings, 1 reply; 2+ messages in thread
From: Jan-Benedict Glaw @ 2021-09-15 19:26 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

Hi!

I accidentally had a bad user.email setting ("jbglaw@ług-owl.de"
instead of "jbglaw@lug-owl.de") and this leads to incomplete HTML
being generated by gitweb, along with an error message:

index.cgi: Wide character in subroutine entry at /usr/share/gitweb/index.cgi line 2208.

This patch may fix it, but I'm NOT a Perl guy:

--- a/gitweb/gitweb.perl	2021-09-15 20:23:13.788195846 +0200
+++ b/gitweb/gitweb.perl	2021-09-15 20:24:19.911806868 +0200
@@ -2193,7 +2193,7 @@
 	my $size = shift;
 	$avatar_cache{$email} ||=
 		"//www.gravatar.com/avatar/" .
-			md5_hex($email) . "?s=";
+			md5_hex(utf8::is_utf8($email)? Encode::encode_utf8($email): $email) . "?s=";
 	return $avatar_cache{$email} . $size;
 }


Comments?

Thanks,
  Jan-Benedict

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* *ping* [PATCH RFC] gitweb: Handle non-ASCII email addresses
  2021-09-15 19:26 [PATCH RFC] gitweb: Handle non-ASCII email addresses Jan-Benedict Glaw
@ 2021-09-22 17:42 ` Jan-Benedict Glaw
  0 siblings, 0 replies; 2+ messages in thread
From: Jan-Benedict Glaw @ 2021-09-22 17:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

[-- Attachment #1: Type: text/plain, Size: 974 bytes --]

Hi!

On Wed, 2021-09-15 21:26:47 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> I accidentally had a bad user.email setting ("jbglaw@ług-owl.de"
> instead of "jbglaw@lug-owl.de") and this leads to incomplete HTML
> being generated by gitweb, along with an error message:
> 
> index.cgi: Wide character in subroutine entry at /usr/share/gitweb/index.cgi line 2208.
> 
> This patch may fix it, but I'm NOT a Perl guy:
> 
> --- a/gitweb/gitweb.perl	2021-09-15 20:23:13.788195846 +0200
> +++ b/gitweb/gitweb.perl	2021-09-15 20:24:19.911806868 +0200
> @@ -2193,7 +2193,7 @@
>  	my $size = shift;
>  	$avatar_cache{$email} ||=
>  		"//www.gravatar.com/avatar/" .
> -			md5_hex($email) . "?s=";
> +			md5_hex(utf8::is_utf8($email)? Encode::encode_utf8($email): $email) . "?s=";
>  	return $avatar_cache{$email} . $size;
>  }
> 
> 
> Comments?

I'd like to get some comment on this, maybe for anybody to merge it?

Thanks,
  Jan-Benedict

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-22 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 19:26 [PATCH RFC] gitweb: Handle non-ASCII email addresses Jan-Benedict Glaw
2021-09-22 17:42 ` *ping* " Jan-Benedict Glaw

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).