Opened 9 months ago
Last modified 9 months ago
#61286 assigned defect (bug)
PHP message: PHP Fatal error: Uncaught Error: Undefined constant "ABSPATH" in wp-includes/cache.php
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | major | Version: | 6.5.3 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
PHP message: PHP Fatal error: Uncaught Error: Undefined constant "ABSPATH" in /var/wp-includes/cache.php:12
request_uri': '/wp-content/cache.php'
Attachments (1)
Change History (9)
This ticket was mentioned in PR #6620 on WordPress/wordpress-develop by @deepakrohilla.
9 months ago
#1
- Keywords has-patch added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/61286
#2
@
9 months ago
- Focuses performance privacy sustainability coding-standards php-compatibility removed
#3
@
9 months ago
@deepakrohilla thanks for opening the ticket. the fix on your PR looks good, some small feedback to address there before commit.
It would be nice to add some steps to reproduce here as it is not obvious how you encountered the error from your ticket description. Understanding how the issue occurs also helps with having a clear commit message for the fix.
#6
@
9 months ago
- Keywords changes-requested removed
@adamsilverstein Thanks for the feedback.
For reproducing this issue:
In address bar of the browser directly hit url like <domain-name>/wp-includes/cache.php it will produce 500 and message will be look like below on browser screen.
This page isn’t working
<domain-name> is currently unable to handle this request.
HTTP ERROR 500
#7
@
9 months ago
Hi there, thanks for the ticket!
A similar issue was addressed in [49619] / #35835 for wp-includes/rss-functions.php
.
Unless I'm missing something, calling directly pretty much any other file in wp-includes
or wp-admin/includes
would lead to the same issue, so if we want to add an early exit, it might be a good idea to do that in a consistent way.
#8
@
9 months ago
@SergeyBiryukov I have cover maximum number of files of wp-includes & wp-admin directory and raised in https://core.trac.wordpress.org/ticket/61314#ticket with patch
PHP message: PHP Fatal error: Uncaught Error: Undefined constant "ABSPATH" in /wp-includes/cache.php:12