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:
kj
2026-06-13 15:30:16 -03:00
parent 3c9db3ac53
commit 5312e5060e

View File

@@ -423,6 +423,7 @@ class Model
protected function update(): void protected function update(): void
{ {
$atts = $this->getVars(); $atts = $this->getVars();
static::$dbQueryVariables = [];
foreach ($atts as $key => $value) { foreach ($atts as $key => $value) {
if (isset($value)) { if (isset($value)) {
@@ -457,6 +458,7 @@ class Model
$atts = $this->getVars(); $atts = $this->getVars();
$into = []; $into = [];
$values = []; $values = [];
static::$dbQueryVariables = [];
foreach ($atts as $key => $value) { foreach ($atts as $key => $value) {
if (isset($value)) { if (isset($value)) {