From a03401429b1db2cfc484aff20b9767fbd7cae401 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Mon, 30 Sep 2024 01:56:14 +0000 Subject: [PATCH] Editor: Prevent direct access to `/wp-includes/blocks/index.php`. Adds a check for `ABSPATH` to the top of the `/wp-includes/blocks/index.php` file and prevents the file from loading if it is not defined. This prevents the file from throwing errors when accessed directly. Props khokansardar, mukesh27. Fixes #62108. See #60352. Built from https://develop.svn.wordpress.org/trunk@59117 git-svn-id: http://core.svn.wordpress.org/trunk@58513 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/blocks/index.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/blocks/index.php b/wp-includes/blocks/index.php index 40967727da..360d14d62d 100644 --- a/wp-includes/blocks/index.php +++ b/wp-includes/blocks/index.php @@ -5,6 +5,11 @@ * @package WordPress */ +// Don't load directly. +if ( ! defined( 'ABSPATH' ) ) { + die( '-1' ); +} + define( 'BLOCKS_PATH', ABSPATH . WPINC . '/blocks/' ); // Include files required for core blocks registration. diff --git a/wp-includes/version.php b/wp-includes/version.php index 3af834d66c..dab55e8b23 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-59116'; +$wp_version = '6.7-alpha-59117'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.