Opened 4 years ago

Closed 4 years ago

#9645 closed defect (bug) (fixed)

Misplaced close parentheses in query.php

Reported by: coffee2code Owned by: anonymous
Priority: normal Milestone: 2.8
Component: General Version: 2.8
Severity: normal Keywords: has-patch
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 4 years ago.
9645.2.diff (1.6 KB) - added by coffee2code 4 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)

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

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.

  • 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.