Make WordPress Core

Ticket #43501: Normalized_paths_for_replacement_in_debug_backtrace_.patch

File Normalized_paths_for_replacement_in_debug_backtrace_.patch, 1.2 KB (added by Rarst, 7 years ago)
  • wp-includes/functions.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    51345134        $check_class = ! is_null( $ignore_class );
    51355135        $skip_frames++; // skip this function
    51365136
     5137        static $truncate_paths;
     5138
     5139        if ( ! isset( $truncate_paths ) ) {
     5140                $truncate_paths = array(
     5141                        wp_normalize_path( WP_CONTENT_DIR ),
     5142                        wp_normalize_path( ABSPATH )
     5143                );
     5144        }
     5145
    51375146        foreach ( $trace as $call ) {
    51385147                if ( $skip_frames > 0 ) {
    51395148                        $skip_frames--;
     
    51465155                        if ( in_array( $call['function'], array( 'do_action', 'apply_filters' ) ) ) {
    51475156                                $caller[] = "{$call['function']}('{$call['args'][0]}')";
    51485157                        } elseif ( in_array( $call['function'], array( 'include', 'include_once', 'require', 'require_once' ) ) ) {
    5149                                 $caller[] = $call['function'] . "('" . str_replace( array( WP_CONTENT_DIR, ABSPATH ) , '', $call['args'][0] ) . "')";
     5158                                $caller[] = $call['function'] . "('" . str_replace( $truncate_paths, '', wp_normalize_path( $call['args'][0] ) ) . "')";
    51505159                        } else {
    51515160                                $caller[] = $call['function'];
    51525161                        }