yii2-netdisk/models/RenameForm.php
Chenx221 ed463be4f1
更新正则表达式
排除更多非法字符
2024-02-12 14:03:10 +08:00

20 lines
375 B
PHP

<?php
namespace app\models;
use yii\base\Model;
class RenameForm extends Model
{
public $newName;
public function rules()
{
return [
['newName', 'required'],
['newName', 'string', 'max' => 255],
['newName', 'match', 'pattern' => '/^[^\p{C}\/:*?"<>|\\\\]+$/u', 'message' => 'Invalid file name.'],
];
}
}