Ticket #22117: 22117.patch
File 22117.patch, 1.5 KB (added by , 12 years ago) |
---|
-
wp-includes/functions.php
3688 3688 $caller = array(); 3689 3689 $check_class = ! is_null( $ignore_class ); 3690 3690 $skip_frames++; // skip this function 3691 $last_info = array(); 3691 3692 3692 3693 foreach ( $trace as $call ) { 3694 if ( isset( $call['class'] ) && 'wpdb' == $call['class'] ) 3695 { 3696 $last_info['file'] = basename($call['file']); 3697 $last_info['line'] = $call['line']; 3698 } 3699 3693 3700 if ( $skip_frames > 0 ) { 3694 3701 $skip_frames--; 3695 3702 } elseif ( isset( $call['class'] ) ) { … … 3697 3704 continue; // Filter out calls 3698 3705 3699 3706 $caller[] = "{$call['class']}{$call['type']}{$call['function']}"; 3707 if( empty( $last_info['func'] ) ) $last_info['func'] = $call['class'].'->'.$call['function']; 3700 3708 } else { 3701 3709 if ( in_array( $call['function'], array( 'do_action', 'apply_filters' ) ) ) { 3702 3710 $caller[] = "{$call['function']}('{$call['args'][0]}')"; … … 3704 3712 $caller[] = $call['function'] . "('" . str_replace( array( WP_CONTENT_DIR, ABSPATH ) , '', $call['args'][0] ) . "')"; 3705 3713 } else { 3706 3714 $caller[] = $call['function']; 3715 if( empty( $last_info['func'] ) ) $last_info['func'] = $call['function']; 3707 3716 } 3708 3717 } 3709 3718 } 3710 3719 if ( $pretty ) 3711 return join( ', ', array_reverse( $caller ) ); 3720 return sprintf(__("Error at %s, at line %d, in function %s<br/>%s"), 3721 $last_info['file'], $last_info['line'], $last_info['func'], join( ', ', array_reverse( $caller ) ) ); 3712 3722 else 3713 3723 return $caller; 3714 3724 }