Make WordPress Core

Changes between Initial Version and Version 8 of Ticket #63303


Ignore:
Timestamp:
04/18/2025 03:32:21 PM (8 weeks ago)
Author:
sabernhardt
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #63303

    • Property Keywords has-patch dev-feedback has-testing-info added
    • Property Version changed from 6.8 to
  • Ticket #63303 – Description

    initial v8  
    11When attempting to directly access `wp-settings.php` via a browser (e.g., navigating to `https://example.com/wp-settings.php`), a fatal error is triggered:
    22
    3 [16-Apr-2025 19:58:43 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "ABSPATH" in /home/example/public_html/wp-settings.php:34
     3{{{
     4[16-Apr-2025 19:58:43 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "ABSPATH" in /.../wp-settings.php:34
    45
    56Stack trace:
    67#0 {main}
    7   thrown in /home/example/public_html/wp-settings.php on line 34
     8  thrown in /.../wp-settings.php on line 34
     9}}}
    810
    911This occurs because `ABSPATH` is not defined unless `wp-settings.php` is loaded through `wp-config.php`.
    1012
    11 ### Suggested Solution:
     13=== Suggested Solution:
    1214
    1315To avoid direct access and prevent such fatal errors, I recommend adding a conditional check at the top of the `wp-settings.php` file like this:
    1416
    15 ```php
     17{{{#!php
    1618if ( ! defined( 'ABSPATH' ) ) {
    1719    exit;
    1820}
     21}}}