Ticket #16953: 16953.2.diff
File 16953.2.diff, 891 bytes (added by , 11 years ago) |
---|
-
wp-includes/plugin.php
563 563 * @uses WP_PLUGIN_DIR 564 564 */ 565 565 function plugin_basename($file) { 566 $arg = $file; 566 567 $file = str_replace('\\','/',$file); // sanitize for Win32 installs 567 568 $file = preg_replace('|/+|','/', $file); // remove any duplicate slash 568 569 $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs … … 571 572 $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash 572 573 $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir 573 574 $file = trim($file, '/'); 574 return $file;575 return apply_filters( 'plugin_basename', $file, $arg ); 575 576 } 576 577 577 578 /**