From 30caafae4081eac8276b3461d3dcafea2deef77c Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 13 Apr 2019 04:45:05 +0000 Subject: [PATCH] Bootstrap/Load: Remove duplicate leading slashes on inclusion of various files under `ABSPATH`. Props dmsnell, birgire, szepe.viktor. Fixes #46327. git-svn-id: https://develop.svn.wordpress.org/trunk@45190 602fd350-edb4-49c9-b593-d223f7449a82 --- src/index.php | 2 +- src/wp-admin/includes/ajax-actions.php | 2 +- src/wp-admin/includes/class-wp-debug-data.php | 4 ++-- src/wp-admin/includes/class-wp-site-health-auto-updates.php | 4 ++-- src/wp-includes/class-wp-customize-manager.php | 2 +- src/wp-includes/class-wp-customize-widgets.php | 2 +- .../customize/class-wp-widget-form-customize-control.php | 2 +- .../rest-api/endpoints/class-wp-rest-posts-controller.php | 2 +- src/wp-includes/update.php | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/index.php b/src/index.php index b7a223bead..c76c36d72d 100644 --- a/src/index.php +++ b/src/index.php @@ -12,7 +12,7 @@ if ( ! defined( 'ABSPATH' ) ) { } if ( file_exists( ABSPATH . 'wp-includes/js/dist/edit-post.js' ) ) { - require_once ABSPATH . '/_index.php'; + require_once ABSPATH . '_index.php'; return; } diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index 89c8474222..456f229c61 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -3620,7 +3620,7 @@ function wp_ajax_crop_image() { switch ( $context ) { case 'site-icon': - require_once ABSPATH . '/wp-admin/includes/class-wp-site-icon.php'; + require_once ABSPATH . 'wp-admin/includes/class-wp-site-icon.php'; $wp_site_icon = new WP_Site_Icon(); // Skip creating a new attachment if the attachment is a Site Icon. diff --git a/src/wp-admin/includes/class-wp-debug-data.php b/src/wp-admin/includes/class-wp-debug-data.php index 758ed51c24..299c88ec35 100644 --- a/src/wp-admin/includes/class-wp-debug-data.php +++ b/src/wp-admin/includes/class-wp-debug-data.php @@ -666,9 +666,9 @@ class WP_Debug_Data { ); // Check if a .htaccess file exists. - if ( is_file( ABSPATH . '/.htaccess' ) ) { + if ( is_file( ABSPATH . '.htaccess' ) ) { // If the file exists, grab the content of it. - $htaccess_content = file_get_contents( ABSPATH . '/.htaccess' ); + $htaccess_content = file_get_contents( ABSPATH . '.htaccess' ); // Filter away the core WordPress rules. $filtered_htaccess_content = trim( preg_replace( '/\# BEGIN WordPress[\s\S]+?# END WordPress/si', '', $htaccess_content ) ); diff --git a/src/wp-admin/includes/class-wp-site-health-auto-updates.php b/src/wp-admin/includes/class-wp-site-health-auto-updates.php index 90046ee6b4..8321370d81 100644 --- a/src/wp-admin/includes/class-wp-site-health-auto-updates.php +++ b/src/wp-admin/includes/class-wp-site-health-auto-updates.php @@ -350,10 +350,10 @@ class WP_Site_Health_Auto_Updates { if ( 'wp-content' == substr( $file, 0, 10 ) ) { continue; } - if ( ! file_exists( ABSPATH . '/' . $file ) ) { + if ( ! file_exists( ABSPATH . $file ) ) { continue; } - if ( ! is_writable( ABSPATH . '/' . $file ) ) { + if ( ! is_writable( ABSPATH . $file ) ) { $unwritable_files[] = $file; } } diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index e4e6dfa810..1700259a1d 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -402,7 +402,7 @@ final class WP_Customize_Manager { // Add theme update notices. if ( current_user_can( 'install_themes' ) || current_user_can( 'update_themes' ) ) { - require_once ABSPATH . '/wp-admin/includes/update.php'; + require_once ABSPATH . 'wp-admin/includes/update.php'; add_action( 'customize_controls_print_footer_scripts', 'wp_print_admin_notice_templates' ); } } diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index 47f7db1584..e5e5445118 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -949,7 +949,7 @@ final class WP_Customize_Widgets { } global $wp_registered_widgets, $wp_registered_widget_controls; - require_once ABSPATH . '/wp-admin/includes/widgets.php'; // for next_widget_id_number() + require_once ABSPATH . 'wp-admin/includes/widgets.php'; // for next_widget_id_number() $sort = $wp_registered_widgets; usort( $sort, array( $this, '_sort_name_callback' ) ); diff --git a/src/wp-includes/customize/class-wp-widget-form-customize-control.php b/src/wp-includes/customize/class-wp-widget-form-customize-control.php index 260b417f46..cfab188606 100644 --- a/src/wp-includes/customize/class-wp-widget-form-customize-control.php +++ b/src/wp-includes/customize/class-wp-widget-form-customize-control.php @@ -96,7 +96,7 @@ class WP_Widget_Form_Customize_Control extends WP_Customize_Control { } // Get the widget_control and widget_content. - require_once ABSPATH . '/wp-admin/includes/widgets.php'; + require_once ABSPATH . 'wp-admin/includes/widgets.php'; $widget = $wp_registered_widgets[ $this->widget_id ]; if ( ! isset( $widget['params'][0] ) ) { diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index bc0a179f7f..0e3489c183 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -1614,7 +1614,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { if ( is_post_type_viewable( $post_type_obj ) && $post_type_obj->public ) { if ( ! function_exists( 'get_sample_permalink' ) ) { - require_once ABSPATH . '/wp-admin/includes/post.php'; + require_once ABSPATH . 'wp-admin/includes/post.php'; } $sample_permalink = get_sample_permalink( $post->ID, $post->post_title, '' ); diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php index c815d157aa..824575099b 100644 --- a/src/wp-includes/update.php +++ b/src/wp-includes/update.php @@ -595,8 +595,8 @@ function wp_update_themes( $extra_stats = array() ) { * @since 3.7.0 */ function wp_maybe_auto_update() { - include_once( ABSPATH . '/wp-admin/includes/admin.php' ); - include_once( ABSPATH . '/wp-admin/includes/class-wp-upgrader.php' ); + include_once( ABSPATH . 'wp-admin/includes/admin.php' ); + include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); $upgrader = new WP_Automatic_Updater; $upgrader->run();