Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#5847 closed enhancement (fixed)

ABSPATH checks could be simpler

Reported by: johnjamesjacoby Owned by: johnjamesjacoby
Priority: normal Milestone: 2.2
Component: Core Version:
Severity: normal 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)

#1 @netweb
12 years ago

Related: #5891

#2 @DJPaul
12 years ago

  • Milestone 2.2Future Release

#3 @johnjamesjacoby
12 years ago

  • Owner set to johnjamesjacoby
  • Resolutionfixed
  • Status newclosed

In 9351:

SimplifyABSPATH checks across all files for improved Scrutinizer compliance.

See #5891. Fixes #5847.

#4 @johnjamesjacoby
12 years ago

  • Milestone Future Release2.2

#5 @johnjamesjacoby
12 years ago

  • Component Component - Any/AllTools - Code Improvement

#6 @johnjamesjacoby
12 years ago

In 9458:

Simplify more ABSPATH checks. See #5847, #5891, r9351.

#7 @DJPaul
10 years ago

  • Component Tools - Code ImprovementCore

#8 @DJPaul
10 years ago

  • Type taskenhancement
Note: See TracTickets for help on using tickets.