mirror of
https://github.com/WordPress/WordPress.git
synced 2025-12-05 11:24:25 +01:00
General: Stop direct loading of files in /wp-admin that should only be included.
This changeset restricts direct access call in `/wp-admin` and its sub directories. Follow-up to [11768]. Props deepakrohilla. See #61314. Built from https://develop.svn.wordpress.org/trunk@59678 git-svn-id: http://core.svn.wordpress.org/trunk@59021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a79b4ef4c9
commit
0619c6d95a
@ -9,6 +9,11 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// Don't load directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
_deprecated_file( basename( __FILE__ ), '2.5.0', 'wp-admin/includes/admin.php' );
|
||||
|
||||
/** WordPress Administration API: Includes all Administration functions. */
|
||||
|
||||
@ -6,6 +6,11 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// Don't load directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
|
||||
if ( ! defined( 'WP_ADMIN' ) ) {
|
||||
require_once __DIR__ . '/admin.php';
|
||||
|
||||
@ -9,6 +9,11 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// Don't load directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-background.php' );
|
||||
|
||||
/** Custom_Background class */
|
||||
|
||||
@ -9,6 +9,11 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// Don't load directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-image-header.php' );
|
||||
|
||||
/** Custom_Image_Header class */
|
||||
|
||||
@ -6,6 +6,11 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// Don't load directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
/**
|
||||
* The current page.
|
||||
*
|
||||
|
||||
@ -6,6 +6,11 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// Don't load directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs the admin menu.
|
||||
*
|
||||
|
||||
@ -7,6 +7,11 @@
|
||||
* @since 3.1.0
|
||||
*/
|
||||
|
||||
// Don't load directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
/* translators: Network menu item. */
|
||||
$menu[2] = array( __( 'Dashboard' ), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
|
||||
|
||||
|
||||
@ -8,6 +8,11 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// Don't load directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
|
||||
|
||||
if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
|
||||
|
||||
@ -7,6 +7,11 @@
|
||||
* @since 3.1.0
|
||||
*/
|
||||
|
||||
// Don't load directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
die( '-1' );
|
||||
}
|
||||
|
||||
$menu[2] = array( __( 'Dashboard' ), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
|
||||
|
||||
$menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' );
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-alpha-59677';
|
||||
$wp_version = '6.8-alpha-59678';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user