diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f3afe60a9c..ba56521cf3 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -5366,6 +5366,8 @@ function wp_allowed_protocols() { * * @see https://core.trac.wordpress.org/ticket/19589 * + * @staticvar array $truncate_paths Array of paths to truncate. + * * @param string $ignore_class Optional. A class to ignore all function calls within - useful * when you want to just give info about the callee. Default null. * @param int $skip_frames Optional. A number of stack frames to skip - useful for unwinding @@ -5376,6 +5378,8 @@ function wp_allowed_protocols() { * of individual calls. */ function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) { + static $truncate_paths; + if ( version_compare( PHP_VERSION, '5.2.5', '>=' ) ) { $trace = debug_backtrace( false ); } else { @@ -5386,6 +5390,13 @@ function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pr $check_class = ! is_null( $ignore_class ); $skip_frames++; // skip this function + if ( ! isset( $truncate_paths ) ) { + $truncate_paths = array( + wp_normalize_path( WP_CONTENT_DIR ), + wp_normalize_path( ABSPATH ) + ); + } + foreach ( $trace as $call ) { if ( $skip_frames > 0 ) { $skip_frames--; @@ -5399,7 +5410,7 @@ function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pr if ( in_array( $call['function'], array( 'do_action', 'apply_filters' ) ) ) { $caller[] = "{$call['function']}('{$call['args'][0]}')"; } elseif ( in_array( $call['function'], array( 'include', 'include_once', 'require', 'require_once' ) ) ) { - $caller[] = $call['function'] . "('" . str_replace( array( WP_CONTENT_DIR, ABSPATH ), '', $call['args'][0] ) . "')"; + $caller[] = $call['function'] . "('" . str_replace( $truncate_paths, '', wp_normalize_path( $call['args'][0] ) ) . "')"; } else { $caller[] = $call['function']; } diff --git a/wp-includes/version.php b/wp-includes/version.php index d311d51b4e..5ce7e32bd5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42799'; +$wp_version = '5.0-alpha-42800'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.