registerExpiredRules(); } /** * Register these for the compatibility with plugins using old rules. * * @return void */ protected function registerExpiredRules() { Validator::extend('nickname', function ($a, $value, $p, $v) { return $value === e(addslashes(trim($value))); }); Validator::extend('playername', function ($a, $value, $p, $v) { return preg_match('/^([A-Za-z0-9_]+)$/', $value); }); Validator::extend('pname_chinese', function ($a, $value, $p, $v) { return preg_match('/^([A-Za-z0-9_\x{4e00}-\x{9fff}]+)$/u', $value); }); } public function register() { // } }