Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2511,12 +2511,20 @@ |
2512 | 2512 | * @return null |
2513 | 2513 | */ |
2514 | 2514 | function wfDeprecated( $function ) { |
2515 | | - $callers = debug_backtrace(); |
2516 | | - $file = @$callers[2]['file']; |
2517 | | - $line = @$callers[2]['line']; |
2518 | | - $func = @$callers[2]['function']; |
2519 | | - if ( $func && $file ) { |
2520 | | - trigger_error( "Use of $function is deprecated. Called from $func at $file:$line", E_USER_NOTICE ); |
| 2515 | + $callers = wfDebugBacktrace(); |
| 2516 | + if( isset( $callers[2] ) ){ |
| 2517 | + $callerfunc = $callers[2]; |
| 2518 | + $callerfile = $callers[1]; |
| 2519 | + if( isset( $callerfile['file'] ) && isset( $callerfile['line'] ) ){ |
| 2520 | + $file = $callerfile['file'] . ' at line ' . $callerfile['line']; |
| 2521 | + } else { |
| 2522 | + $file = '(internal function)'; |
| 2523 | + } |
| 2524 | + $func = ''; |
| 2525 | + if( isset( $callerfunc['class'] ) ) |
| 2526 | + $func .= $callerfunc['class'] . '::'; |
| 2527 | + $func .= @$callerfunc['function']; |
| 2528 | + trigger_error( "Use of $function is deprecated. Called from $func in $file", E_USER_NOTICE ); |
2521 | 2529 | } else { |
2522 | 2530 | trigger_error( "Use of $function is deprecated.", E_USER_NOTICE ); |
2523 | 2531 | } |