Additional check in where checker

This commit is contained in:
Yurii
2026-06-01 10:46:10 +03:00
parent a58dd81d6e
commit e4a6aea908
2 changed files with 5 additions and 0 deletions

View File

@@ -119,6 +119,10 @@ class Checker
$forbidComplexExpressions = $params->forbidComplexExpressions();
$checkWherePermission = $params->applyPermissionCheck();
if ($attribute && str_contains($attribute, '#')) {
throw new Forbidden("Not allowed character in attribute.");
}
if ($forbidComplexExpressions) {
if (in_array($type, $this->subQueryTypeList)) {
throw new Forbidden("Sub-queries are forbidden in where.");

View File

@@ -463,6 +463,7 @@ class RecordService
->create()
->from(Attachment::ENTITY_TYPE)
->withSearchParams($searchParams)
->withComplexExpressionsForbidden()
->buildQueryBuilder()
->where(
Condition::in(