[wp-trac] [WordPress Trac] #62722: Fix all ABSPATH direct access errors
WordPress Trac
noreply at wordpress.org
Fri Jun 6 23:06:28 UTC 2025
#62722: Fix all ABSPATH direct access errors
-----------------------------------------+------------------------------
Reporter: bor0 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch changes-requested | Focuses:
-----------------------------------------+------------------------------
Comment (by bor0):
> If you can find out which are the steps to generate this file, I think
it would great from a testing perspective (to see if it's actually
generating this code in the right place)
{{{
bor0:~/dev/wordpress-develop$ npm install
...
bor0:~/dev/wordpress-develop$ npm run sync-gutenberg-packages
...
bor0:~/dev/wordpress-develop$ git status src/wp-
includes/blocks/*-blocks.php
On branch 62722
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: src/wp-includes/blocks/require-dynamic-blocks.php
modified: src/wp-includes/blocks/require-static-blocks.php
}}}
I noticed (and had forgotten) about this, so updating another tiny patch:
{{{
--- a/src/wp-includes/blocks/require-dynamic-blocks.php
+++ b/src/wp-includes/blocks/require-dynamic-blocks.php
@@ -4,7 +4,7 @@
// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
- die( '-1' );
+ exit();
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62722#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list