Browse Source

增加非法字符验证

master
suiyi-erff 2 years ago
parent
commit
3f51e173c3
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      application/admin/controller/User.php

+ 1
- 1
application/admin/controller/User.php View File

@@ -106,7 +106,7 @@ class User extends BaseController
try {
$User_model = new \app\admin\model\User();
//去除特殊字符
$_POST['username']=str_replace(array(" ","!","@","#","$","%","^","&","*","(",")","{","}",";","'",",",".","/",":","<",">","?","~","`",".","-","+","-","_","="),'', $_POST['username']);
$_POST['username']=str_replace(array(" ","!","@","#","$","%","^","&","*","(",")","{","}",";","'",",",".","/",":","<",">","?","~","`",".","-","+","-","_","=","¥","!","……"),'', $_POST['username']);
$check = $User_model->where(['username' => $_POST['username']])->value('id');
if ($check) {
tojson(10000, '账号已存在');

Loading…
Cancel
Save