Make WordPress Core

Changeset 54872


Ignore:
Timestamp:
11/24/2022 10:09:39 PM (2 years ago)
Author:
audrasjb
Message:

Coding Standards: Remove extra slashes when concatenating ABSPATH with a path.

Since ABSPATH is defined and documented to end with a forward slash /, this changeset removes the first / from strings appended to ABSPATH in various files, leading to // in the resulting path.

Props TobiasBg, audrasjb, SergeyBiryukov, emanuelx.
Fixes #57074.
See #57071.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php

    r54325 r54872  
    278278        // Make sure the `request_filesystem_credentials()` function is available during our REST API call.
    279279        if ( ! function_exists( 'request_filesystem_credentials' ) ) {
    280             require_once ABSPATH . '/wp-admin/includes/file.php';
     280            require_once ABSPATH . 'wp-admin/includes/file.php';
    281281        }
    282282
     
    329329        // Make sure the `get_core_checksums()` function is available during our REST API call.
    330330        if ( ! function_exists( 'get_core_checksums' ) ) {
    331             require_once ABSPATH . '/wp-admin/includes/update.php';
     331            require_once ABSPATH . 'wp-admin/includes/update.php';
    332332        }
    333333
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r54506 r54872  
    6666    public function show_site_health_tab( $tab ) {
    6767        if ( 'debug' === $tab ) {
    68             require_once ABSPATH . '/wp-admin/site-health-info.php';
     68            require_once ABSPATH . 'wp-admin/site-health-info.php';
    6969        }
    7070    }
  • trunk/src/wp-admin/includes/file.php

    r54442 r54872  
    24432443    // from WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method().
    24442444    if ( ! function_exists( 'submit_button' ) ) {
    2445         require_once ABSPATH . '/wp-admin/includes/template.php';
     2445        require_once ABSPATH . 'wp-admin/includes/template.php';
    24462446    }
    24472447    ?>
  • trunk/tests/phpunit/includes/bootstrap.php

    r53902 r54872  
    303303
    304304// Load WordPress.
    305 require_once ABSPATH . '/wp-settings.php';
     305require_once ABSPATH . 'wp-settings.php';
    306306
    307307// Delete any default posts & related data.
  • trunk/tests/phpunit/includes/install.php

    r53749 r54872  
    3838tests_add_filter( 'wp_die_handler', '_wp_die_handler_filter_exit' );
    3939
    40 require_once ABSPATH . '/wp-settings.php';
     40require_once ABSPATH . 'wp-settings.php';
    4141
    42 require_once ABSPATH . '/wp-admin/includes/upgrade.php';
    43 require_once ABSPATH . '/wp-includes/class-wpdb.php';
     42require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     43require_once ABSPATH . 'wp-includes/class-wpdb.php';
    4444
    4545// Override the PHPMailer.
  • trunk/tests/phpunit/tests/customize/widgets.php

    r52010 r54872  
    557557    private function get_test_widget_control_args() {
    558558        global $wp_registered_widgets;
    559         require_once ABSPATH . '/wp-admin/includes/widgets.php';
     559        require_once ABSPATH . 'wp-admin/includes/widgets.php';
    560560        $widget_id = 'search-2';
    561561        $widget    = $wp_registered_widgets[ $widget_id ];
  • trunk/tests/phpunit/tests/feed/wpSimplePieFile.php

    r52328 r54872  
    2020        parent::set_up_before_class();
    2121
    22         require_once ABSPATH . '/wp-includes/class-simplepie.php';
    23         require_once ABSPATH . '/wp-includes/class-wp-simplepie-file.php';
     22        require_once ABSPATH . 'wp-includes/class-simplepie.php';
     23        require_once ABSPATH . 'wp-includes/class-wp-simplepie-file.php';
    2424    }
    2525
  • trunk/tests/phpunit/tests/pluggable/signatures.php

    r54716 r54872  
    7777    public function get_defined_pluggable_functions() {
    7878
    79         require_once ABSPATH . '/wp-admin/includes/upgrade.php';
     79        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
    8080
    8181        $test_functions = array(
     
    104104
    105105        foreach ( $test_files as $file ) {
    106             preg_match_all( '#^\t?function (\w+)#m', file_get_contents( ABSPATH . '/' . $file ), $functions );
     106            preg_match_all( '#^\t?function (\w+)#m', file_get_contents( ABSPATH . $file ), $functions );
    107107
    108108            foreach ( $functions[1] as $function ) {
  • trunk/tests/phpunit/tests/pluggable/wpMail.php

    r54702 r54872  
    174174
    175175        // Non-fatal errors.
    176         $this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body', "Cc: invalid-address\nBcc: @invalid.address", ABSPATH . '/non-existent-file.html' ) );
     176        $this->assertTrue( wp_mail( 'valid@address.com', 'subject', 'body', "Cc: invalid-address\nBcc: @invalid.address", ABSPATH . 'non-existent-file.html' ) );
    177177
    178178        // Fatal errors.
  • trunk/tests/phpunit/tests/pomo/po.php

    r53850 r54872  
    4949        parent::set_up_before_class();
    5050
    51         require_once ABSPATH . '/wp-includes/pomo/po.php';
     51        require_once ABSPATH . 'wp-includes/pomo/po.php';
    5252    }
    5353
  • trunk/tests/phpunit/tests/post.php

    r54090 r54872  
    286286        }
    287287
    288         require_once ABSPATH . '/wp-admin/includes/post.php';
     288        require_once ABSPATH . 'wp-admin/includes/post.php';
    289289
    290290        $post_id = self::factory()->post->create();
  • trunk/tests/phpunit/tests/widgets.php

    r54402 r54872  
    814814
    815815        wp_widgets_init();
    816         require_once ABSPATH . '/wp-admin/includes/widgets.php';
     816        require_once ABSPATH . 'wp-admin/includes/widgets.php';
    817817        $widget_id    = 'search-2';
    818818        $widget       = $wp_registered_widgets[ $widget_id ];
Note: See TracChangeset for help on using the changeset viewer.