[wp-trac] [WordPress Trac] #60237: Fatal error when someone opens "/wp-includes/blocks" or "/wp-includes/blocks/index.php" directly
WordPress Trac
noreply at wordpress.org
Mon Jan 22 00:44:32 UTC 2024
#60237: Fatal error when someone opens "/wp-includes/blocks" or "/wp-
includes/blocks/index.php" directly
-----------------------------------------+---------------------------
Reporter: akrocks | Owner: rajinsharwar
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.5
Component: Editor | Version: 5.5
Severity: normal | Resolution:
Keywords: has-patch changes-requested | Focuses:
-----------------------------------------+---------------------------
Changes (by rajinsharwar):
* keywords: has-patch => has-patch changes-requested
* owner: (none) => rajinsharwar
* status: reopened => assigned
Comment:
Hi @sakibmd, thanks for your patch, and it works great! But we shouldn't
use a new String for this purpose I believe. As done in other files to
prevent direct access, we can just do something like this:
{{{#!php
// Don't load directly.
if ( ! defined( 'WPINC' ) ) {
die( '-1' );
}
}}}
Feel free to share a new patch soon, and we can get this merged!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60237#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list