v1.0.38: 邮箱/国内手机号/身份证正则格式校验 - 后端validate.php(接入person add/update、duplicate_check账号校验、soft_update、hard_add/convert)前端common.js三函数+person/media/fragment表单提交校验
This commit is contained in:
@@ -12,6 +12,7 @@ require_once __DIR__ . '/../common/logger.php';
|
||||
require_once __DIR__ . '/../common/helpers.php';
|
||||
require_once __DIR__ . '/../common/completeness.php';
|
||||
require_once __DIR__ . '/../common/duplicate_check.php';
|
||||
require_once __DIR__ . '/../common/validate.php';
|
||||
|
||||
checkAjax();
|
||||
checkPermission('preliminary');
|
||||
@@ -57,6 +58,16 @@ switch ($table) {
|
||||
'graduated_from' => 's', 'hometown' => 's', 'work_location' => 's',
|
||||
'id_type' => 's', 'id_number' => 's', 'source_channel' => 's', 'source_detail' => 's',
|
||||
]);
|
||||
// 格式校验:身份证 / 手机 / 邮箱
|
||||
if (!empty($fields['id_number'])) {
|
||||
checkFieldFormat('id_number', $fields['id_number']);
|
||||
}
|
||||
if (isset($_POST['phone'])) {
|
||||
checkFieldFormat('phone', $_POST['phone']);
|
||||
}
|
||||
if (isset($_POST['email'])) {
|
||||
checkFieldFormat('email', $_POST['email']);
|
||||
}
|
||||
// 唯一性校验(排除自身):身份证 / 手机 / 邮箱
|
||||
$dups = [];
|
||||
if (!empty($fields['id_number'])) {
|
||||
|
||||
Reference in New Issue
Block a user