All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: git@vger.kernel.org
Subject: [PATCH RFC] gitweb: Handle non-ASCII email addresses
Date: Wed, 15 Sep 2021 21:26:47 +0200	[thread overview]
Message-ID: <20210915192647.6fnk7ktwldz7uubf@lug-owl.de> (raw)

[-- 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 --]

             reply	other threads:[~2021-09-15 19:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-15 19:26 Jan-Benedict Glaw [this message]
2021-09-22 17:42 ` *ping* [PATCH RFC] gitweb: Handle non-ASCII email addresses Jan-Benedict Glaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210915192647.6fnk7ktwldz7uubf@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.