You appear to be a bot. Output may be restricted
Description
Anonymize a symlinked file name$wp_plugin_paths contains the mapping from the symlinked plugin to the real path for the plugin. We need to convert the real path back to the assumed path so that we can remove the ABSPATH, thereby anonymizing the file name.
$plugin => $real_plugin [C:/apache/htdocs/oikcom/wp-content/plugins/cookie-cat] => c:/apache/htdocs/wordpress/wp-content/plugins/cookie-cat
Usage
$string = bw_trace_anonymize_symlinked_file( $file );
Parameters
- $file
- ( string ) required – the real file
Returns
string the anonymized fileSource
File name: oik-bwtrace/includes/bwtrace.phpLines:
1 to 23 of 23
function bw_trace_anonymize_symlinked_file( $file ) { $fil = str_replace( "\\", "/", $file ); //$fil = strtolower( $fil ); global $wp_plugin_paths; if ( is_array( $wp_plugin_paths) && count( $wp_plugin_paths ) ) { foreach ( $wp_plugin_paths as $plugin => $real_plugin ) { if ( !$real_plugin ) { // That's rather unexpected. But it's not safe to trace here! // bw_trace2( $wp_plugin_paths, "Missing real_plugin", true, BW_TRACE_WARNING ); } else { if ( 0 === strpos( $fil, $real_plugin ) ) { $fil = str_replace( $real_plugin, $plugin, $fil ); $lose = str_replace( "\\", "/", ABSPATH ); $fil = str_replace( $lose , '', $fil ); break; } } } } return( $fil ); }View on GitHub View on Trac