Changes between Initial Version and Version 8 of Ticket #63303
- Timestamp:
- 04/18/2025 03:32:21 PM (8 weeks ago)
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 1 1 When 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: 2 2 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 4 5 5 6 Stack trace: 6 7 #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 }}} 8 10 9 11 This occurs because `ABSPATH` is not defined unless `wp-settings.php` is loaded through `wp-config.php`. 10 12 11 ###Suggested Solution:13 === Suggested Solution: 12 14 13 15 To 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: 14 16 15 ```php17 {{{#!php 16 18 if ( ! defined( 'ABSPATH' ) ) { 17 19 exit; 18 20 } 21 }}}