8000 merged branch Seldaek/fix-deprecated-logs (PR #7587) · symfony/symfony@bf30a3d · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit bf30a3d

Browse files
committed
merged branch Seldaek/fix-deprecated-logs (PR #7587)
This PR was merged into the 2.2 branch. Discussion ---------- [2.2][HttpKernel] Remove args from 5.3 stack traces to avoid filling log files Fixes #7259 - it just makes the PHP 5.3 behavior match the one on 5.4. Commits ------- 99256e4 [HttpKernel] Remove args from 5.3 stack traces to avoid filling log files, fixes #7259
2 parents 6c114ca + 99256e4 commit bf30a3d

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