Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#9645 closed defect (bug) (fixed)

Misplaced close parentheses in query.php

Reported by: coffee2code's profile coffee2code Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.8
Component: General Keywords: has-patch
Focuses: Cc:

Description

There are two places in wp-includes/query.php where we have this:

if ( is_array($ids) && count($ids > 0) ) {

The close parenthesis for count() is misplaced and we probably really want:

if ( is_array($ids) && count($ids) > 0 ) {

These are part of the query handling for category__not_in and tag__not_in.

Patch attached.

Attachments (2)

9645.diff (906 bytes) - added by coffee2code 15 years ago.
9645.2.diff (1.6 KB) - added by coffee2code 15 years ago.
Slight refactoring of code around the area affected by the original patch (this includes original patch).

Download all attachments as: .zip

Change History (4)

@coffee2code
15 years ago

@coffee2code
15 years ago

Slight refactoring of code around the area affected by the original patch (this includes original patch).

#1 @coffee2code
15 years ago

Attachment 9645.2.diff includes the original patch, plus some slight refactoring of the code around it. All told, it trims 12 lines of code down to 4, and removes 4 single-use temporary variables. The 4 lines are still relatively short and clear in intention.

#2 @automattor
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [11086]) Fix categorynot_in and tagnot_in running empty, props coffee2code, fixes #9645

Note: See TracTickets for help on using tickets.