Skip to content

Commit 52f229d

Browse files
committed
Fixing null variables returning true when using different CHARSETs
1 parent 5586f49 commit 52f229d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Database/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private function compile(Builder $builder)
185185
return $v / 1;
186186
} else {
187187
if(env('DB_CHARSET') && env('APPLICATION_CHARSET')) {
188-
return $v == null ? :mb_convert_encoding((string) $v, env('DB_CHARSET'), env('APPLICATION_CHARSET'));
188+
return $v == null ? null :mb_convert_encoding((string) $v, env('DB_CHARSET'), env('APPLICATION_CHARSET'));
189189
} else {
190190
return $v;
191191
}
@@ -624,7 +624,7 @@ public function select($query, $bindings = [], $useReadPdo = true)
624624
if(env('DB_CHARSET') && env('APPLICATION_CHARSET')) {
625625
foreach ($result as $row) {
626626
foreach ($row as $name => $col) {
627-
$row->$name = $col == null ? : mb_convert_encoding($col, env('APPLICATION_CHARSET'), env('DB_CHARSET'));
627+
$row->$name = $col == null ? null : mb_convert_encoding($col, env('APPLICATION_CHARSET'), env('DB_CHARSET'));
628628
}
629629
}
630630
}

0 commit comments

Comments
 (0)