From 5db40bf688b3c8824508566877bd795a48ff9673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Thu, 20 Sep 2018 10:25:36 +0200 Subject: [PATCH] [Web] Implement MD5-CRYPT verification, fixes #1665 --- data/web/inc/functions.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index 6804fec0..94eada4f 100644 --- a/data/web/inc/functions.inc.php +++ b/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) {