Skip to content

Commit

Permalink
Editor: Prevent direct access to /wp-includes/blocks/index.php.
Browse files Browse the repository at this point in the history
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.


git-svn-id: https://develop.svn.wordpress.org/trunk@59117 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
peterwilsoncc committed Sep 30, 2024
1 parent c1fe739 commit 7e30d69
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wp-includes/blocks/index.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' );
}

define( 'BLOCKS_PATH', ABSPATH . WPINC . '/blocks/' );

// Include files required for core blocks registration.
Expand Down

0 comments on commit 7e30d69

Please sign in to comment.