8000 [HttpKernel] Remove args from 5.3 stack traces to avoid filling log f… · symfony/symfony@99256e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 99256e4

Browse files
committed
[HttpKernel] Remove args from 5.3 stack traces to avoid filling log files, fixes #7259
1 parent 6c114ca commit 99256e4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,17 @@ public function handle($level, $message, $file, $line, $context)
8787

8888
if ($level & (E_USER_DEPRECATED | E_DEPRECATED)) {
8989
if (null !== self::$logger) {
90-
$stack = version_compare(PHP_VERSION, '5.4', '<') ? array_slice(debug_backtrace(false), 0, 10) : debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10);
90+
if (version_compare(PHP_VERSION, '5.4', '<')) {
91+
$stack = array_map(
92+
function ($row) {
93+
unset($row['args']);
94+
return $row;
95+
},
96+
array_slice(debug_backtrace(false), 0, 10)
97+
);
98+
} else {
99+
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10);
100+
}
91101

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

0 commit comments

Comments
 (0)
0