1
0
Эх сурвалжийг харах

[Web] Implement MD5-CRYPT verification, fixes #1665

André 7 жил өмнө
parent
commit
5db40bf688

+ 6 - 0
data/web/inc/functions.inc.php

@@ -266,6 +266,12 @@ function verify_hash($hash, $password) {
       return true;
     }
   }
+  elseif (preg_match('/^{MD5-CRYPT}/i', $hash)) {
+    $hash = preg_replace('/^{MD5-CRYPT}/i', '', $hash);
+    if (password_verify($password, $hash)) {
+      return true;
+    }
+  }
   return false;
 }
 function check_login($user, $pass) {