From: Frédéric Buclin Date: Mon, 12 May 2014 17:25:45 +0000 (+0200) Subject: Bug 1003852: Digest::SHA 5.82 and newer always croak on wide characters, preventing... X-Git-Tag: bugzilla-4.5.5~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d694e688d2b129e6091ee5045066f09f4578f14e;p=thirdparty%2Fbugzilla.git Bug 1003852: Digest::SHA 5.82 and newer always croak on wide characters, preventing users with Unicode passwords from logging in r/a=glob --- diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 9bcb6962d1..4f0711b7e0 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -624,13 +624,13 @@ sub bz_crypt { $algorithm = $1; } + # Wide characters cause crypt and Digest to die. + if (Bugzilla->params->{'utf8'}) { + utf8::encode($password) if utf8::is_utf8($password); + } + my $crypted_password; if (!$algorithm) { - # Wide characters cause crypt to die - if (Bugzilla->params->{'utf8'}) { - utf8::encode($password) if utf8::is_utf8($password); - } - # Crypt the password. $crypted_password = crypt($password, $salt); }