]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1003852: Digest::SHA 5.82 and newer always croak on wide characters, preventing...
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 12 May 2014 17:25:45 +0000 (19:25 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 12 May 2014 17:25:45 +0000 (19:25 +0200)
r/a=glob

Bugzilla/Util.pm

index 9bcb6962d1893fa35bd57141f25f04644bc02226..4f0711b7e0c74e62329436bf27ba73ee8b5738c4 100644 (file)
@@ -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);
     }