Adjusted how drive letter is trimmed and improved test.

This commit is contained in:
Andrey Savchenko committed 2018-11-13 17:49:29 +02:00
1 parent a2d92585ac
commit 9fee649a64
2 files changed
+8 -4

No files matched your search

+7 -3
View File
@@ -29,8 +29,8 @@ class Backtrace_Formatter {
public function __construct() {
$this->truncate_paths = [
wp_normalize_path( realpath( WP_CONTENT_DIR ) ),
wp_normalize_path( realpath( ABSPATH ) ),
wp_normalize_path( WP_CONTENT_DIR ),
wp_normalize_path( ABSPATH ),
'wp-admin/',
'themes/',
'plugins/',
@@ -83,7 +83,11 @@ class Backtrace_Formatter {
$path = substr( $item, strpos( $item, '(\'' ) + 2, - 2 );
$path = wp_normalize_path( $path );
$path = ltrim( str_replace( $this->truncate_paths, '', $path ), '/' );
$path = str_replace( $this->truncate_paths, '', $path );
if ( ':' === $path[1] ) {
$path = substr( $path, 2 );
}
$path = ltrim( $path, '/' );
return $path;
}