공통데이터 관리 수정

This commit is contained in:
yangsh
2025-12-31 15:11:40 +09:00
parent 38444fcb4f
commit 04a06f1781
36 changed files with 1351 additions and 139 deletions

View File

@@ -237,3 +237,33 @@ function han($s)
}
// function to_han ($str) { return preg_replace('/(\\\u[a-f0-9]+)+/e','han("$0")',$str); }
/**
* 비밀번호 문자 조합 검사
* - 영문 대문자 / 소문자 / 숫자 / 특수문자 중 최소 $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;
}