Make WordPress Core

Changeset 59678


Ignore:
Timestamp:
01/22/2025 02:04:34 PM (4 months ago)
Author:
audrasjb
Message:

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.

Location:
trunk/src/wp-admin
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/admin-functions.php

    r47198 r59678  
    1010 */
    1111
     12// Don't load directly.
     13if ( ! defined( 'ABSPATH' ) ) {
     14    die( '-1' );
     15}
     16
    1217_deprecated_file( basename( __FILE__ ), '2.5.0', 'wp-admin/includes/admin.php' );
    1318
  • trunk/src/wp-admin/admin-header.php

    r58997 r59678  
    66 * @subpackage Administration
    77 */
     8
     9// Don't load directly.
     10if ( ! defined( 'ABSPATH' ) ) {
     11    die( '-1' );
     12}
    813
    914header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
  • trunk/src/wp-admin/custom-background.php

    r47198 r59678  
    1010 */
    1111
     12// Don't load directly.
     13if ( ! defined( 'ABSPATH' ) ) {
     14    die( '-1' );
     15}
     16
    1217_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-background.php' );
    1318
  • trunk/src/wp-admin/custom-header.php

    r47198 r59678  
    1010 */
    1111
     12// Don't load directly.
     13if ( ! defined( 'ABSPATH' ) ) {
     14    die( '-1' );
     15}
     16
    1217_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-image-header.php' );
    1318
  • trunk/src/wp-admin/menu-header.php

    r58449 r59678  
    66 * @subpackage Administration
    77 */
     8
     9// Don't load directly.
     10if ( ! defined( 'ABSPATH' ) ) {
     11    die( '-1' );
     12}
    813
    914/**
  • trunk/src/wp-admin/menu.php

    r59161 r59678  
    66 * @subpackage Administration
    77 */
     8
     9// Don't load directly.
     10if ( ! defined( 'ABSPATH' ) ) {
     11    die( '-1' );
     12}
    813
    914/**
  • trunk/src/wp-admin/network/menu.php

    r56515 r59678  
    77 * @since 3.1.0
    88 */
     9
     10// Don't load directly.
     11if ( ! defined( 'ABSPATH' ) ) {
     12    die( '-1' );
     13}
    914
    1015/* translators: Network menu item. */
  • trunk/src/wp-admin/options-head.php

    r58069 r59678  
    99 */
    1010
     11// Don't load directly.
     12if ( ! defined( 'ABSPATH' ) ) {
     13    die( '-1' );
     14}
     15
    1116$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
    1217
  • trunk/src/wp-admin/user/menu.php

    r47198 r59678  
    77 * @since 3.1.0
    88 */
     9
     10// Don't load directly.
     11if ( ! defined( 'ABSPATH' ) ) {
     12    die( '-1' );
     13}
    914
    1015$menu[2] = array( __( 'Dashboard' ), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
Note: See TracChangeset for help on using the changeset viewer.