Skip to content

Commit

Permalink
[HttpKernel] Remove args from 5.3 stack traces to avoid filling log f…
Browse files Browse the repository at this point in the history
…iles, fixes #7259
  • Loading branch information
Seldaek committed Apr 7, 2013
1 parent 6c114ca commit 99256e4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php
Expand Up @@ -87,7 +87,17 @@ public function handle($level, $message, $file, $line, $context)

if ($level & (E_USER_DEPRECATED | E_DEPRECATED)) {
if (null !== self::$logger) {
$stack = version_compare(PHP_VERSION, '5.4', '<') ? array_slice(debug_backtrace(false), 0, 10) : debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10);
if (version_compare(PHP_VERSION, '5.4', '<')) {
$stack = array_map(
function ($row) {
unset($row['args']);
return $row;
},
array_slice(debug_backtrace(false), 0, 10)
);
} else {
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10);
}

self::$logger->warning($message, array('type' => self::TYPE_DEPRECATION, 'stack' => $stack));
}
Expand Down

0 comments on commit 99256e4

Please sign in to comment.