From e114dfb79cab98a0446ef96dc96f2646ab7a3a24 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 16 Jan 2025 16:16:15 +0000 Subject: [PATCH] Upload: Remove redundant check for `ABSPATH` in `wp-admin/async-upload.php`. This aims to bring consistency with a similar fragment in other files, since relocating `wp-admin` or `wp-load.php` is not supported at this time. Follow-up to [6659], [7971], [8315]. Props hussain896, swissspidy, knutsp, SergeyBiryukov. Fixes #62809. git-svn-id: https://develop.svn.wordpress.org/trunk@59634 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/admin-post.php | 7 ++----- src/wp-admin/admin.php | 1 + src/wp-admin/async-upload.php | 7 ++----- src/wp-includes/ms-files.php | 2 ++ 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/wp-admin/admin-post.php b/src/wp-admin/admin-post.php index be32e0710ac92..f880c41ac26a0 100644 --- a/src/wp-admin/admin-post.php +++ b/src/wp-admin/admin-post.php @@ -13,11 +13,8 @@ define( 'WP_ADMIN', true ); } -if ( defined( 'ABSPATH' ) ) { - require_once ABSPATH . 'wp-load.php'; -} else { - require_once dirname( __DIR__ ) . '/wp-load.php'; -} +/** Load WordPress Bootstrap */ +require_once dirname( __DIR__ ) . '/wp-load.php'; /** Allow for cross-domain requests (from the front end). */ send_origin_headers(); diff --git a/src/wp-admin/admin.php b/src/wp-admin/admin.php index 630765f77d03a..dac51ba1aa21e 100644 --- a/src/wp-admin/admin.php +++ b/src/wp-admin/admin.php @@ -31,6 +31,7 @@ define( 'WP_LOAD_IMPORTERS', true ); } +/** Load WordPress Bootstrap */ require_once dirname( __DIR__ ) . '/wp-load.php'; nocache_headers(); diff --git a/src/wp-admin/async-upload.php b/src/wp-admin/async-upload.php index a146f6a48a71b..683fd83248fd0 100644 --- a/src/wp-admin/async-upload.php +++ b/src/wp-admin/async-upload.php @@ -14,11 +14,8 @@ define( 'WP_ADMIN', true ); } -if ( defined( 'ABSPATH' ) ) { - require_once ABSPATH . 'wp-load.php'; -} else { - require_once dirname( __DIR__ ) . '/wp-load.php'; -} +/** Load WordPress Bootstrap */ +require_once dirname( __DIR__ ) . '/wp-load.php'; require_once ABSPATH . 'wp-admin/admin.php'; diff --git a/src/wp-includes/ms-files.php b/src/wp-includes/ms-files.php index 2efe452faf37e..42826ede61c6f 100644 --- a/src/wp-includes/ms-files.php +++ b/src/wp-includes/ms-files.php @@ -10,6 +10,8 @@ define( 'MS_FILES_REQUEST', true ); define( 'SHORTINIT', true ); + +/** Load WordPress Bootstrap */ require_once dirname( __DIR__ ) . '/wp-load.php'; if ( ! is_multisite() ) {