Skip to content

Commit 6e3149e

Browse files
committed
Escape value for update method too
1 parent 918ff74 commit 6e3149e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/LaravelBatch.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ public function update($table, $values, $index)
4949
{
5050
if ($field !== $index)
5151
{
52-
$value = (is_null($val[$field]) ? 'NULL' : '"' . $val[$field] . '"' );
53-
$final[$field][] = 'WHEN `'. $index .'` = "' . $val[$index] . '" THEN ' . $value . ' ';
52+
$value = (is_null($val[$field]) ? 'NULL' : '"' . Helpers::mysql_escape($val[$field]) . '"');
53+
$final[$field][] = 'WHEN `'. $index .'` = "' . $val[$index] . '" THEN ' . $value . ' ';
54+
5455
}
5556
}
5657
}

0 commit comments

Comments
 (0)