Merge branch 'feature/template'
This commit is contained in:
@@ -237,6 +237,7 @@ function han($s)
|
||||
}
|
||||
// function to_han ($str) { return preg_replace('/(\\\u[a-f0-9]+)+/e','han("$0")',$str); }
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
if (! function_exists('db_now')) {
|
||||
/**
|
||||
@@ -251,4 +252,36 @@ if (! function_exists('db_now')) {
|
||||
// 포맷이 없으면 기본 NOW() 반환
|
||||
return new \CodeIgniter\Database\RawSql('NOW()');
|
||||
}
|
||||
}
|
||||
}
|
||||
=======
|
||||
/**
|
||||
* 비밀번호 문자 조합 검사
|
||||
* - 영문 대문자 / 소문자 / 숫자 / 특수문자 중 최소 $minTypes 종류 이상
|
||||
*/
|
||||
function checkPasswordTypes(string $password, int $minTypes = 2): bool
|
||||
{
|
||||
$types = 0;
|
||||
|
||||
// 대문자
|
||||
if (preg_match('/[A-Z]/', $password)) {
|
||||
$types++;
|
||||
}
|
||||
|
||||
// 소문자
|
||||
if (preg_match('/[a-z]/', $password)) {
|
||||
$types++;
|
||||
}
|
||||
|
||||
// 숫자
|
||||
if (preg_match('/[0-9]/', $password)) {
|
||||
$types++;
|
||||
}
|
||||
|
||||
// 특수문자 (공백 제외)
|
||||
if (preg_match('/[^A-Za-z0-9]/', $password)) {
|
||||
$types++;
|
||||
}
|
||||
|
||||
return $types >= $minTypes;
|
||||
}
|
||||
>>>>>>> feature/template
|
||||
|
||||
Reference in New Issue
Block a user