From 5a297941da4c9fca99371fae77689ad5cb798012 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Tue, 13 May 2014 00:24:28 +0800 Subject: Bug 1003852: Digest::SHA 5.82 and newer always croak on wide characters, preventing users with Unicode passwords from logging in --- 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 75427af14..56685d109 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -626,13 +626,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