소스 검색

不可使用非法字符

master
suiyi-erff 2 년 전
부모
커밋
47e70b9e24
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4
    0
      application/admin/controller/User.php

+ 4
- 0
application/admin/controller/User.php 파일 보기

@@ -105,6 +105,10 @@ class User extends BaseController
{
try {
$User_model = new \app\admin\model\User();
//去除空格
if (!preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $_POST['username'])) {
tojson(202, '不可使用非法字符');
}
$_POST['username']=str_replace(" ",'', $_POST['username']);
$check = $User_model->where(['username' => $_POST['username']])->value('id');
if ($check) {

Loading…
취소
저장