Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#32756 closed defect (bug) (fixed)

Notice in `WP_Tax_Query::get_sql_for_clause()`

Reported by: dlh's profile dlh Owned by: boonebgorges's profile boonebgorges
Milestone: 4.3 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: Cc:

Description

WP_Tax_Query::get_sql_for_clause() provides a default empty string for the $join variable, but not for $where.

This can lead to a undefined-variable notice from $sql['where'][] = $where if the received $clause['operator'] isn't covered in the method's conditionals.

The attached patch would create $where with $join.

Attachments (1)

32756.patch (333 bytes) - added by dlh 9 years ago.

Download all attachments as: .zip

Change History (3)

@dlh
9 years ago

#1 @boonebgorges
9 years ago

  • Milestone changed from Awaiting Review to 4.3

Thanks for the ticket!

#2 @boonebgorges
9 years ago

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

In 32910:

Fix PHP notice in WP_Tax_Query::get_sql_for_clause().

Previously, the $where variable was not initialized, so that when an invalid
'operator' was passed, PHP would complain that $where was undefined.

Props dlh.
Fixes #32756.

Note: See TracTickets for help on using tickets.