From 03ab39de72ee57d365f72a5da80b4c16ae2d31fe Mon Sep 17 00:00:00 2001 From: liugang Date: Fri, 22 Dec 2023 18:55:28 +0800 Subject: [PATCH] * adminModel: both check encrypted weak password and password with clear text. --- module/admin/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/admin/model.php b/module/admin/model.php index c465a3bff4..fecbcac979 100755 --- a/module/admin/model.php +++ b/module/admin/model.php @@ -83,11 +83,11 @@ class adminModel extends model $weaks = array(); foreach(explode(',', $this->config->safe->weak) as $weak) { - $weak = md5(trim($weak)); - $weaks[$weak] = $weak; + $weaks[$weak] = md5(trim($weak)); } if(isset($weaks[$user->password])) return true; + if(in_array($user->password, $weaks)) return true; if($user->password == md5($user->account)) return true; if($user->phone && $user->password == md5($user->phone)) return true; if($user->mobile && $user->password == md5($user->mobile)) return true;