Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught exception 'Error' with message 'Undefined constant "ABSPATH"' wp-includes & wp-admin directory files #6665

Open
wants to merge 18 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/wp-admin/admin-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
5 changes: 5 additions & 0 deletions src/wp-admin/admin-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
5 changes: 5 additions & 0 deletions src/wp-admin/custom-background.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
5 changes: 5 additions & 0 deletions src/wp-admin/custom-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
5 changes: 5 additions & 0 deletions src/wp-admin/menu-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
* @subpackage Administration
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/**
* The current page.
*
Expand Down
5 changes: 5 additions & 0 deletions src/wp-admin/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
* @subpackage Administration
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/**
* Constructs the admin menu.
*
Expand Down
5 changes: 5 additions & 0 deletions src/wp-admin/network/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand Down
5 changes: 5 additions & 0 deletions src/wp-admin/options-head.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
* @subpackage Administration
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die();
}

$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';

if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
Expand Down
5 changes: 5 additions & 0 deletions src/wp-admin/user/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/class-IXR.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
* @license http://www.opensource.org/licenses/bsd-license.php BSD
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

require_once ABSPATH . WPINC . '/IXR/class-IXR-server.php';

require_once ABSPATH . WPINC . '/IXR/class-IXR-base64.php';
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/class-wp-customize-control.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @since 3.4.0
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/**
* Customize Control class.
*
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/class-wp-customize-panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @since 4.0.0
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/**
* Customize Panel class.
*
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/class-wp-customize-setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @since 3.4.0
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/**
* Customize Setting class.
*
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/class-wp-http.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @since 2.7.0
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

if ( ! class_exists( 'WpOrg\Requests\Autoload' ) ) {
require ABSPATH . WPINC . '/Requests/src/Autoload.php';

Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/class-wp-simplepie-sanitize-kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @since 4.7.0
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/**
* Core class used to implement SimplePie feed sanitization.
*
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/class-wp-text-diff-renderer-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @since 4.7.0
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/**
* Table renderer to display the diff lines.
*
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/default-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
* @package WordPress
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

// Strip, trim, kses, special chars for string saves.
foreach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) {
add_filter( $filter, 'sanitize_text_field' );
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/default-widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @since 2.8.0
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/** WP_Widget_Pages class */
require_once ABSPATH . WPINC . '/widgets/class-wp-widget-pages.php';

Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/feed-atom.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
* @package WordPress
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

header( 'Content-Type: ' . feed_content_type( 'atom' ) . '; charset=' . get_option( 'blog_charset' ), true );
$more = 1;

Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
* @package WordPress
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

require ABSPATH . WPINC . '/option.php';

/**
Expand Down
4 changes: 4 additions & 0 deletions src/wp-includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
* @subpackage Media
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* Retrieves additional image sizes.
*
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/ms-blogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
* @since MU (3.0.0)
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

require_once ABSPATH . WPINC . '/ms-site.php';
require_once ABSPATH . WPINC . '/ms-network.php';

Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/ms-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
* @since 3.0.0
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/**
* Objects representing the current network and current site.
*
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/nav-menu-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @since 3.0.0
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

/** Walker_Nav_Menu class */
require_once ABSPATH . WPINC . '/class-walker-nav-menu.php';

Expand Down
6 changes: 6 additions & 0 deletions src/wp-includes/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
* @param bool $force_check Whether to bypass the transient cache and force a fresh update check.
* Defaults to false, true if $extra_stats is set.
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

function wp_version_check( $extra_stats = array(), $force_check = false ) {
global $wpdb, $wp_local_package;

Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/vars.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
* @package WordPress
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

global $pagenow,
$is_lynx, $is_gecko, $is_winIE, $is_macIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $is_IE, $is_edge,
$is_apache, $is_IIS, $is_iis7, $is_nginx, $is_caddy;
Expand Down
5 changes: 5 additions & 0 deletions src/wp-includes/wp-diff.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
* @subpackage Diff
*/

// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}

if ( ! class_exists( 'Text_Diff', false ) ) {
/** Text_Diff class */
require ABSPATH . WPINC . '/Text/Diff.php';
Expand Down
Loading