fix(model): reset dbQueryVariables before update and insert
Clear the static $dbQueryVariables array before performing update and insert operations to prevent data leakage between queries.
This commit is contained in:
@@ -423,6 +423,7 @@ class Model
|
||||
protected function update(): void
|
||||
{
|
||||
$atts = $this->getVars();
|
||||
static::$dbQueryVariables = [];
|
||||
|
||||
foreach ($atts as $key => $value) {
|
||||
if (isset($value)) {
|
||||
@@ -457,6 +458,7 @@ class Model
|
||||
$atts = $this->getVars();
|
||||
$into = [];
|
||||
$values = [];
|
||||
static::$dbQueryVariables = [];
|
||||
|
||||
foreach ($atts as $key => $value) {
|
||||
if (isset($value)) {
|
||||
|
||||
Reference in New Issue
Block a user