summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Util.pm
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2014-05-12 19:25:45 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2014-05-12 19:25:45 +0200
commitd694e688d2b129e6091ee5045066f09f4578f14e (patch)
tree1c2646cd935fb5b0097494327c18fc03cb4caf84 /Bugzilla/Util.pm
parent70e8ab711072845b5a39394268e70a88729e9d9a (diff)
downloadbugzilla-d694e688d2b129e6091ee5045066f09f4578f14e.tar.gz
bugzilla-d694e688d2b129e6091ee5045066f09f4578f14e.tar.xz
Bug 1003852: Digest::SHA 5.82 and newer always croak on wide characters, preventing users with Unicode passwords from logging in
r/a=glob
Diffstat (limited to 'Bugzilla/Util.pm')
-rw-r--r--Bugzilla/Util.pm10
1 files changed, 5 insertions, 5 deletions
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);
}