diff --git wp-admin/includes/plugin.php wp-admin/includes/plugin.php
index c931783..6709a1e 100644
|
|
|
function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen |
| 537 | 537 | if ( !empty($redirect) ) |
| 538 | 538 | wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error |
| 539 | 539 | ob_start(); |
| 540 | | include_once(WP_PLUGIN_DIR . '/' . $plugin); |
| | 540 | wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin ); |
| | 541 | include_once( WP_PLUGIN_DIR . '/' . $plugin ); |
| 541 | 542 | |
| 542 | 543 | if ( ! $silent ) { |
| 543 | 544 | /** |
diff --git wp-includes/functions.php wp-includes/functions.php
index c4dc1e7..c9f45f3 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, |
| | 1435 | * and ensures 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( '\\', '/', $path ); |
| | 1442 | $path = preg_replace( '|/+|','/', $path ); |
| | 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..6b6ae49 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 ); |
| | 602 | } |
| | 603 | |
| | 604 | /** |
| | 605 | * Register a plugin's real path. |
| | 606 | * |
| | 607 | * This is used in {@see plugin_basename()} to resolve symlinked paths. |
| | 608 | * |
| | 609 | * @param string $file Known path to the file. |
| | 610 | */ |
| | 611 | function wp_register_plugin_realpath( $file ) { |
| | 612 | global $wp_plugin_paths; |
| | 613 | |
| | 614 | $plugin_path = wp_normalize_path( dirname( $file ) ); |
| | 615 | $plugin_realpath = wp_normalize_path( dirname( realpath( $file ) ) ); |
| | 616 | |
| | 617 | if ( $plugin_path !== $plugin_realpath ) { |
| | 618 | $wp_plugin_paths[ $plugin_path ] = $plugin_realpath; |
| | 619 | } |
| 586 | 620 | } |
| 587 | 621 | |
| 588 | 622 | /** |
diff --git wp-settings.php wp-settings.php
index 24aee93..46e4e74 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 | $GLOBALS['wp_plugin_paths'] = array(); |
| | 198 | foreach ( wp_get_active_and_valid_plugins() as $plugin ) { |
| | 199 | wp_register_plugin_realpath($plugin); |
| | 200 | |
| 198 | 201 | include_once( $plugin ); |
| | 202 | } |
| 199 | 203 | unset( $plugin ); |
| 200 | 204 | |
| 201 | 205 | // Load pluggable functions. |