Skip to content

Commit

Permalink
Fix #19668: Fix Error null check PHP 8.1 `yii\validators\FilterValida…
Browse files Browse the repository at this point in the history
…tor`
  • Loading branch information
samuelexyz committed Nov 15, 2022
1 parent 6997cda commit 199d1f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Yii Framework 2 Change Log
- Bug #19316: Fix MysqlMutex with same connection but difference database (kamarton)
- Bug #19507: Fix eager loading of nested one-to-many relations (spo0okie)
- Bug #19546: Reverted #19309 (bizley)
- Bug #19668: Fix Error null check PHP 8.1 `yii\validators\FilterValidator` (samuelexyz)
- Bug #19670: Fix Error null check PHP 8.1 `yii\rbac\DbManager` (samuelexyz)
- Bug #19520: Fix for TIMESTAMP & ROWVERSION columns in MSSQL insert query (darkdef)

Expand Down
2 changes: 1 addition & 1 deletion validators/FilterValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function init()
public function validateAttribute($model, $attribute)
{
$value = $model->$attribute;
if (!$this->skipOnArray || !is_array($value)) {
if ((!$this->skipOnArray || !is_array($value)) && $value) {
$model->$attribute = call_user_func($this->filter, $value);
}
}
Expand Down

0 comments on commit 199d1f0

Please sign in to comment.