Skip to content

Commit

Permalink
Bootstrap/Load: Remove duplicate leading slashes on inclusion of vari…
Browse files Browse the repository at this point in the history
…ous 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
  • Loading branch information
SergeyBiryukov committed Apr 13, 2019
1 parent 5f93c86 commit 30caafa
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/index.php
Expand Up @@ -12,7 +12,7 @@
}

if ( file_exists( ABSPATH . 'wp-includes/js/dist/edit-post.js' ) ) {
require_once ABSPATH . '/_index.php';
require_once ABSPATH . '_index.php';
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/ajax-actions.php
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-wp-debug-data.php
Expand Up @@ -666,9 +666,9 @@ static function 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 ) );
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/includes/class-wp-site-health-auto-updates.php
Expand Up @@ -350,10 +350,10 @@ function test_all_files_writable() {
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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-customize-manager.php
Expand Up @@ -402,7 +402,7 @@ public function __construct( $args = array() ) {

// 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' );
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-customize-widgets.php
Expand Up @@ -949,7 +949,7 @@ public function get_available_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' ) );
Expand Down
Expand Up @@ -96,7 +96,7 @@ public function to_json() {
}

// 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] ) ) {
Expand Down
Expand Up @@ -1614,7 +1614,7 @@ public function prepare_item_for_response( $post, $request ) {
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, '' );
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/update.php
Expand Up @@ -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();
Expand Down

0 comments on commit 30caafa

Please sign in to comment.