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
This commit is contained in:
Peter Wilson 2024-09-30 01:56:14 +00:00
parent 849b0c0e5e
commit a03401429b
2 changed files with 6 additions and 1 deletions

View File

@ -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.

View File

@ -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.