Skip to content

Commit 2fe4cce

Browse files
committed
add type checking in prepareConditions() method
1 parent c869481 commit 2fe4cce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/QueryBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,10 @@ private function prepareConditions($where): array
361361
$field = $this->prepareField($cond[0]);
362362
$value = $cond[1];
363363

364-
if (strtolower($value) == 'is null') {
364+
if (is_string($value) && strtolower($value) == 'is null') {
365365
$operator = 'IS NULL';
366366
$sql .= "({$field} {$operator})";
367-
} else if (strtolower($value) == 'is not null') {
367+
} else if (is_string($value) && strtolower($value) == 'is not null') {
368368
$operator = 'IS NOT NULL';
369369
$sql .= "({$field} {$operator})";
370370
} else if (is_array($value)) {

0 commit comments

Comments
 (0)