浏览代码

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

André 7 年之前
父节点
当前提交
5db40bf688
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      data/web/inc/functions.inc.php

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

@@ -266,6 +266,12 @@ function verify_hash($hash, $password) {
       return true;
       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;
   return false;
 }
 }
 function check_login($user, $pass) {
 function check_login($user, $pass) {