mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Debug::caller() will now handle errors from outside function calls (#6029)
This commit is contained in:
parent
e93a376332
commit
32d1856d40
@ -89,11 +89,12 @@ class Debug {
|
||||
*/
|
||||
public static function caller() {
|
||||
$bt = debug_backtrace();
|
||||
$caller = $bt[2];
|
||||
$caller = isset($bt[2]) ? $bt[2] : array();
|
||||
$caller['line'] = $bt[1]['line'];
|
||||
$caller['file'] = $bt[1]['file'];
|
||||
if(!isset($caller['class'])) $caller['class'] = '';
|
||||
if(!isset($caller['type'])) $caller['type'] = '';
|
||||
if(!isset($caller['function'])) $caller['function'] = '';
|
||||
return $caller;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user