Skip to content

Commit a61bfa0

Browse files
committed
Fixed alias not checking if key is of closure/callable type.
1 parent f34f132 commit a61bfa0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Pecee/Pixie/QueryBuilder/Adapters/BaseAdapter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,13 @@ protected function buildCriteria(array $statements, bool $bindValues = true): ar
137137

138138
$key = $statement['key'];
139139

140+
$key = $this->wrapSanitizer($key);
141+
140142
// Add alias non-existing
141-
if($this->aliasPrefix !== null && strpos($key, '.') === false) {
143+
if(is_string($key) && $this->aliasPrefix !== null && strpos($key, '.') === false) {
142144
$key = $this->aliasPrefix . '.' . $key;
143145
}
144146

145-
$key = $this->wrapSanitizer($key);
146-
147147
if ($statement['key'] instanceof Raw) {
148148
$bindings[] = $statement['key']->getBindings();
149149
}

0 commit comments

Comments
 (0)