Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#62108 closed defect (bug) (fixed)

Add direct access check to /wp-includes/blocks/index.php

Reported by: peterwilsoncc Owned by: peterwilsoncc
Priority: normal Milestone: 6.7
Component: Editor Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Related to #60352.

As servers are typically set to use index.php as a default when directories are accessed, the use of the file in /wp-includes/blocks/ can result in filling the logs files with noise due to fatal errors as search engines test the URL for validity.

As a temporary fix for this, I suggest adding an ABSPATH check to the file and dying gracefully to prevent noise.

There is a pull request linked to the earlier ticket that can be used as a starting point.

Change History (5)

#1 @sabernhardt
2 years ago

  • Component GeneralEditor

#3 @mukesh27
2 years ago

#62121 was marked as a duplicate.

@mukesh27 commented on PR #7437:


2 years ago
#4

As mention in ticket description there is already a PR https://github.com/WordPress/wordpress-develop/pull/6635

#5 @peterwilsoncc
2 years ago

  • Owner set to peterwilsoncc
  • Resolutionfixed
  • Status newclosed

In 59117:

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.

Note: See TracTickets for help on using tickets.