Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #35 from mg-code/fix-scenario-bug
Browse files Browse the repository at this point in the history
Security bug using scenario
  • Loading branch information
tonydspaniard authored Aug 21, 2018
2 parents 8f9190e + 21a040c commit 8de9559
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/EditableAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ public function run()
if ($this->scenario !== null) {
$model->setScenario($this->scenario);
}
$model->$attribute = $value;
$model->setAttributes([
$attribute => $value
]);

if ($model->validate([$attribute])) {
// no need to specify which attributes as Yii2 handles that via [[BaseActiveRecord::getDirtyAttributes]]
Expand Down

0 comments on commit 8de9559

Please sign in to comment.