[wp-trac] [WordPress Trac] #62722: Fix all ABSPATH direct access errors

WordPress Trac noreply at wordpress.org
Tue Jun 10 13:01:26 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):

 > But as I told you, if these two files are being automatically generated,
 it doesnt make sense that you include them in this patch right?. I assume
 that they will be included among many other changes that `sync-gutenberg-
 packages` introduce in the code.

 Correct, but I still don't know at which point in the release process they
 get automatically generated, so I thought I'd include that as part of the
 patch since it's not changing any functionality. But if you feel strongly
 about it, I'm happy to exclude.

 > Finally, in `tools/release/sync-stable-blocks.js` line 39 you are adding
 a new line, but I think there you were intending to add the anti-load
 code.

 The static file doesn't generate the error, this is why I decided to
 exclude it:

 {{{
 bor0:~$ curl "http://localhost:8080/wp-includes/blocks/require-dynamic-
 blocks.php"
 <br />
 <b>Fatal error</b>:  Uncaught Error: Undefined constant
 "ABSPATH" in /opt/homebrew/var/www/wp-includes/blocks/require-
 dynamic-blocks.php:5
 Stack trace:
 #0 {main}
   thrown in <b>/opt/homebrew/var/www/wp-includes/blocks/require-dynamic-
 blocks.php</b> on line <b>5</b><br />
 bor0:~$ curl "http://localhost:8080/wp-includes/blocks/require-static-
 blocks.php"
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62722#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list