diff --git a/WP_fix_for_plugin_basename_to_allow_symlinks_2011-07-28.patch b/WP_fix_for_plugin_basename_to_allow_symlinks_2011-07-28.patch
index 95e39fc..e69de29 100644
a
|
b
|
|
1 | | diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php |
2 | | index 945461c..5bc475d 100644 |
3 | | --- a/wp-includes/plugin.php |
4 | | +++ b/wp-includes/plugin.php |
5 | | @@ -567,7 +567,11 @@ function plugin_basename($file) { |
6 | | $mu_plugin_dir = str_replace('\\','/',WPMU_PLUGIN_DIR); // sanitize for Win32 installs |
7 | | $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash |
8 | | $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir |
9 | | - $file = trim($file, '/'); |
10 | | + |
11 | | + $dir = basename(dirname($file)); |
12 | | + $filename = basename($file); |
13 | | + |
14 | | + $file = trim($dir . '/' . $filename, '/'); |
15 | | return $file; |
16 | | } |
17 | | |
diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php
index 5bc475d..5b5e693 100644
a
|
b
|
function plugin_basename($file) { |
568 | 568 | $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash |
569 | 569 | $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir |
570 | 570 | |
571 | | $dir = basename(dirname($file)); |
572 | | $filename = basename($file); |
| 571 | $dir = basename(dirname($file)); |
| 572 | $filename = basename($file); |
| 573 | $filepath = ($dir == '.') ? $filename : $dir . '/' . $filename; |
| 574 | |
| 575 | $file = trim($filepath, '/'); |
573 | 576 | |
574 | | $file = trim($dir . '/' . $filename, '/'); |
575 | 577 | return $file; |
576 | 578 | } |
577 | 579 | |