Remove deprecated validation rules

This commit is contained in:
Pig Fang 2019-03-31 08:41:55 +08:00
parent 7eaf166063
commit d867b0921b

View File

@ -45,28 +45,6 @@ class ValidatorExtendServiceProvider extends ServiceProvider
return preg_match($regexp, $value);
});
$this->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()