8000 Added check to prevent call on types other than Expression · lozobojan/laravel-framework@60039e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 60039e7

Browse files
author
Bojan Lozo
committed
Added check to prevent call on types other than Expression
1 parent d19e995 commit 60039e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Illuminate/Database/Query/Grammars/Grammar.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Database\Concerns\CompilesJsonPaths;
66
use Illuminate\Database\Grammar as BaseGrammar;
77
use Illuminate\Database\Query\Builder;
8+
use Illuminate\Database\Query\Expression;
89
use Illuminate\Database\Query\JoinClause;
910
use Illuminate\Support\Arr;
1011
use RuntimeException;
@@ -246,7 +247,7 @@ protected function concatenateWhereClauses($query, $sql)
246247
*/
247248
protected function whereRaw(Builder $query, $where)
248249
{
249-
return $where['sql']->getValue($this);
250+
return $where['sql'] instanceof Expression ? $where['sql']->getValue($this) : $where['sql'];
250251
}
251252

252253
/**

0 commit comments

Comments
 (0)
0