From 60552ba96bc116c67193579432e561dd0348616e Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 15 Sep 2025 00:30:00 +0900 Subject: [PATCH] Throw error in filterValue() if an unstringable object is given --- common/framework/parsers/dbquery/VariableBase.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/framework/parsers/dbquery/VariableBase.php b/common/framework/parsers/dbquery/VariableBase.php index 0c5f984dd..f4e29a0c5 100644 --- a/common/framework/parsers/dbquery/VariableBase.php +++ b/common/framework/parsers/dbquery/VariableBase.php @@ -398,7 +398,11 @@ class VariableBase // Don't apply a filter if there is no variable. $column = $this instanceof ColumnWrite ? $this->name : $this->column; $filter = isset($this->filter) ? $this->filter : ''; - if (!is_array($value) && strval($value) === '') + if (is_object($value) && !method_exists($value, '__toString')) + { + throw new \Rhymix\Framework\Exceptions\QueryError('Variable ' . $this->var . ' for column ' . $column . ' is not stringable'); + } + if (is_scalar($value) && strval($value) === '') { $filter = ''; }