diff --git a/app/Controllers/AdminController.php b/app/Controllers/AdminController.php index 15b5943c..c1ddbc7a 100644 --- a/app/Controllers/AdminController.php +++ b/app/Controllers/AdminController.php @@ -8,6 +8,7 @@ use App\Models\Player; use App\Models\PlayerModel; use App\Models\Texture; use App\Exceptions\E; +use Validate; use Utils; use View; diff --git a/app/Controllers/AuthController.php b/app/Controllers/AuthController.php index 145ed239..2dea1ef4 100644 --- a/app/Controllers/AuthController.php +++ b/app/Controllers/AuthController.php @@ -5,6 +5,7 @@ namespace App\Controllers; use App\Models\User; use App\Models\UserModel; use App\Exceptions\E; +use Validate; use Mail; use View; use Utils; diff --git a/app/Controllers/PlayerController.php b/app/Controllers/PlayerController.php index 877111ec..79c3b38f 100644 --- a/app/Controllers/PlayerController.php +++ b/app/Controllers/PlayerController.php @@ -7,6 +7,7 @@ use App\Models\Player; use App\Models\PlayerModel; use App\Models\Texture; use App\Exceptions\E; +use Validate; use Utils; use Option; use View; @@ -36,7 +37,7 @@ class PlayerController extends BaseController if (!isset($player_name)) View::json('你还没有填写要添加的角色名哦', 1); - if (!\Validate::playerName($player_name)) + if (!Validate::playerName($player_name)) { $msg = "无效的角色名。角色名只能包含" . ((Option::get('allow_chinese_playername') == "1") ? "汉字、" : "")."字母、数字以及下划线"; View::json($msg, 2); @@ -85,7 +86,7 @@ class PlayerController extends BaseController if (!$new_player_name) throw new E('Invalid parameters', 1); - if (!\Validate::playerName($new_player_name)) + if (!Validate::playerName($new_player_name)) { $msg = "无效的角色名。角色名只能包含" . ((Option::get('allow_chinese_playername') == "1") ? "汉字、" : "")."字母、数字以及下划线"; View::json($msg, 2); diff --git a/app/Controllers/SkinlibController.php b/app/Controllers/SkinlibController.php index 42bb8a09..9334fb15 100644 --- a/app/Controllers/SkinlibController.php +++ b/app/Controllers/SkinlibController.php @@ -5,6 +5,7 @@ namespace App\Controllers; use App\Models\User; use App\Models\Texture; use App\Exceptions\E; +use Validate; use Option; use Utils; use View; @@ -169,7 +170,7 @@ class SkinlibController extends BaseController public function delete() { - \Validate::checkPost(['tid']); + Validate::checkPost(['tid']); $result = Texture::find($_POST['tid']); @@ -208,8 +209,8 @@ class SkinlibController extends BaseController } public function rename() { - \Validate::checkPost(['tid', 'new_name']); - \Validate::textureName($_POST['new_name']); + Validate::checkPost(['tid', 'new_name']); + Validate::textureName($_POST['new_name']); $t = Texture::find($_POST['tid']); @@ -227,7 +228,7 @@ class SkinlibController extends BaseController private function checkUpload($type) { - \Validate::textureName(Utils::getValue('name', $_POST)); + Validate::textureName(Utils::getValue('name', $_POST)); if (!Utils::getValue('file', $_FILES)) View::json('你还没有选择任何文件哟', 1);