From d694e688d2b129e6091ee5045066f09f4578f14e Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Mon, 12 May 2014 19:25:45 +0200 Subject: Bug 1003852: Digest::SHA 5.82 and newer always croak on wide characters, preventing users with Unicode passwords from logging in r/a=glob --- Bugzilla/Util.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 9bcb6962d..4f0711b7e 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); } -- cgit v1.2.3-24-g4f1b