#5847 closed enhancement (fixed)
ABSPATH checks could be simpler
Reported by: | johnjamesjacoby | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | |
Cc: |
Description
We currently do:
if ( !defined( 'ABSPATH' ) ) exit;
But could get away with:
defined( 'ABSPATH' ) || exit;
Two wins here:
- Simpler code and a bit easier on the eyes
- Passes code styling linters looking for brackets on comparisons
129 instances would need changing. The task is trivial, but the changes are sprawling. I figure we can do this in 2.2 to avoid changing basically every file in the project while in beta, but if no one is vehemently opposed, we can do this pretty much anytime.
Change History (8)
Note: See
TracTickets for help on using
tickets.
Related: #5891