mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-29 01:10:42 +08:00
[Legacy] Fix #543: Make StackTraceErrorHandler $errcontext parameter optional
The $errcontext parameter was deprecated in PHP 7.2+ and removed in PHP 8.0+, causing ArgumentCountError when PHP's internal error handler calls the function with only 4 arguments instead of the expected 5. Made $errcontext parameter optional with null default value to maintain backward compatibility while fixing the stack trace functionality. - Fix public/legacy/include/utils.php:3933 StackTraceErrorHandler function signature - Resolves 500 errors when stack_trace_errors is enabled - Maintains backward compatibility for legacy code calling with 5 arguments
This commit is contained in:
parent
1ac4f6d699
commit
ca50436c6d
1 changed files with 1 additions and 1 deletions
|
@ -3930,7 +3930,7 @@ function display_stack_trace($textOnly = false)
|
|||
return $out;
|
||||
}
|
||||
|
||||
function StackTraceErrorHandler($errno, $errstr, $errfile, $errline, $errcontext)
|
||||
function StackTraceErrorHandler($errno, $errstr, $errfile, $errline, $errcontext = null)
|
||||
{
|
||||
$error_msg = " $errstr occurred in <b>$errfile</b> on line $errline [" . date('Y-m-d H:i:s') . ']';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue