Skip to content

Commit

Permalink
Refactor code to access fields securely (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbclaudio authored Dec 21, 2023
1 parent b0374e0 commit b121594
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ protected static function getReplaceValue(Model $model, string $replaceKey)
$model instanceof Category => str_replace('category_', '', $replaceKey)
};

return $model->{str_replace(['[', ']'], '', $replace)} ?? null;
return $model->attributesToArray()[str_replace(['[', ']'], '', $replace)] ?? null;
}
}

0 comments on commit b121594

Please sign in to comment.