summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2014-05-12 18:24:28 +0200
committerByron Jones <glob@mozilla.com>2014-05-12 18:24:28 +0200
commit5a297941da4c9fca99371fae77689ad5cb798012 (patch)
tree518e9840a20505bc389bd3e22c48369fd25a6c5a /Bugzilla
parentdf4a99ff6453f6e1a3bdef1d39c5ab828df326c3 (diff)
downloadbugzilla-5a297941da4c9fca99371fae77689ad5cb798012.tar.gz
bugzilla-5a297941da4c9fca99371fae77689ad5cb798012.tar.xz
Bug 1003852: Digest::SHA 5.82 and newer always croak on wide characters, preventing users with Unicode passwords from logging in
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Util.pm10
1 files changed, 5 insertions, 5 deletions
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);