5.0.0 - 普通 - 已处理
ThinkPHP5.1.13中,如果场景未设置,仅通过only([‘’])来设置时,导致无效。 /**
* 获取数据验证的场景
* @access protected
* @param string $scene 验证场景
* @return void
*/
protected function getScene($scene = '')
{
if (empty($scene)) {
// 读取指定场景
$scene = $this->currentScene;
}
$this->only = $this->append = $this->remove = [];
if (empty($scene)) {
return;
}建议修改为 /**
* 获取数据验证的场景
* @access protected
* @param string $scene 验证场景
* @return void
*/
protected function getScene($scene = '')
{
if (empty($scene)) {
// 读取指定场景
$scene = $this->currentScene;
}
if (empty($scene)) {
return;
}
$this->only = $this->append = $this->remove = []; 