Fix #17929: Actions can now have bool typed params bound

This commit is contained in:
Alex
2020-03-24 15:44:43 +00:00
committed by GitHub
parent 31e3698ab9
commit 4b6d3c0290
4 changed files with 9 additions and 3 deletions

View File

@ -147,6 +147,9 @@ class Controller extends \yii\base\Controller
case 'float':
$params[$name] = filter_var($params[$name], FILTER_VALIDATE_FLOAT, FILTER_NULL_ON_FAILURE);
break;
case 'bool':
$params[$name] = filter_var($params[$name], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
break;
}
if ($params[$name] === null) {
$isValid = false;