Skip to content

Commit

Permalink
Truncate params in DBALException::formatParameters doctrine#2523
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
  • Loading branch information
shtrom committed Sep 28, 2016
1 parent ec8fc16 commit 5c9a8ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Doctrine/DBAL/DBALException.php
Expand Up @@ -168,6 +168,9 @@ private static function wrapException(Driver $driver, \Exception $driverEx, $msg
private static function formatParameters(array $params)
{
return '[' . implode(', ', array_map(function ($param) {
if (is_string ($param)) {
$param = mb_strimwidth($param, 0, 240, "...");
}
$json = @json_encode($param);

if (! is_string($json) || $json == 'null' && is_string($param)) {
Expand Down

0 comments on commit 5c9a8ab

Please sign in to comment.