diff --git wp-includes/functions.php wp-includes/functions.php
index c4dc1e7..6367dce 100644
|
|
function path_join( $base, $path ) { |
1429 | 1429 | } |
1430 | 1430 | |
1431 | 1431 | /** |
| 1432 | * Normalize a filesystem path |
| 1433 | * |
| 1434 | * Replaces backslashes with forward slashes for Windows systems, and ensures |
| 1435 | * no duplicate slashes exist. |
| 1436 | * |
| 1437 | * @param string $path Path to normalize |
| 1438 | * @return string Normalized path |
| 1439 | */ |
| 1440 | function wp_normalize_path( $path ) { |
| 1441 | $path = str_replace( '\\', '/', $file ); |
| 1442 | $path = preg_replace( '|/+|','/', $file ); |
| 1443 | return $path; |
| 1444 | } |
| 1445 | |
| 1446 | /** |
1432 | 1447 | * Determines a writable directory for temporary files. |
1433 | 1448 | * Function's preference is the return value of <code>sys_get_temp_dir()</code>, |
1434 | 1449 | * followed by your PHP temporary upload directory, followed by WP_CONTENT_DIR, |
diff --git wp-includes/plugin.php wp-includes/plugin.php
index 03c4ac3..c8029f4 100644
|
|
function remove_all_actions($tag, $priority = false) { |
574 | 574 | * @uses WP_PLUGIN_DIR |
575 | 575 | */ |
576 | 576 | function plugin_basename($file) { |
577 | | $file = str_replace('\\','/',$file); // sanitize for Win32 installs |
578 | | $file = preg_replace('|/+|','/', $file); // remove any duplicate slash |
579 | | $plugin_dir = str_replace('\\','/',WP_PLUGIN_DIR); // sanitize for Win32 installs |
580 | | $plugin_dir = preg_replace('|/+|','/', $plugin_dir); // remove any duplicate slash |
581 | | $mu_plugin_dir = str_replace('\\','/',WPMU_PLUGIN_DIR); // sanitize for Win32 installs |
582 | | $mu_plugin_dir = preg_replace('|/+|','/', $mu_plugin_dir); // remove any duplicate slash |
| 577 | global $wp_plugin_paths; |
| 578 | $original_file = $file; |
| 579 | |
| 580 | foreach ($wp_plugin_paths as $dir => $realdir) { |
| 581 | if (strpos($file, $realdir) === 0) { |
| 582 | $file = $dir . substr( $file, strlen( $realdir ) ); |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | $file = wp_normalize_path($file); |
| 587 | $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR ); |
| 588 | $mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR ); |
| 589 | |
583 | 590 | $file = preg_replace('#^' . preg_quote($plugin_dir, '#') . '/|^' . preg_quote($mu_plugin_dir, '#') . '/#','',$file); // get relative path from plugins dir |
584 | 591 | $file = trim($file, '/'); |
585 | | return $file; |
| 592 | |
| 593 | /** |
| 594 | * Filter the plugin's basename. |
| 595 | * |
| 596 | * @since 3.7.0 |
| 597 | * |
| 598 | * @param string $file Resolved basename. |
| 599 | * @param string $original_file Filename passed into the function. |
| 600 | */ |
| 601 | return apply_filters( 'plugin_basename', $file, $original_file ); |
586 | 602 | } |
587 | 603 | |
588 | 604 | /** |
diff --git wp-settings.php wp-settings.php
index 24aee93..2618326 100644
|
|
create_initial_post_types(); |
194 | 194 | register_theme_directory( get_theme_root() ); |
195 | 195 | |
196 | 196 | // Load active plugins. |
197 | | foreach ( wp_get_active_and_valid_plugins() as $plugin ) |
| 197 | $wp_plugin_paths = array(); |
| 198 | foreach ( wp_get_active_and_valid_plugins() as $plugin ) { |
| 199 | $plugin_path = wp_normalize_path( dirname( $plugin ) ); |
| 200 | $plugin_realpath = wp_normalize_path( dirname( realpath( $plugin ) ) ); |
| 201 | |
| 202 | if ( $plugin_path !== $plugin_realpath ) { |
| 203 | $wp_plugin_paths[ $plugin_path ] = $plugin_realpath; |
| 204 | } |
| 205 | |
198 | 206 | include_once( $plugin ); |
199 | | unset( $plugin ); |
| 207 | } |
| 208 | unset( $plugin, $plugin_path, $plugin_realpath ); |
200 | 209 | |
201 | 210 | // Load pluggable functions. |
202 | 211 | require( ABSPATH . WPINC . '/pluggable.php' ); |