WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#16825 closed defect (bug) (fixed)

Conflict var name in _get_meta_sql

Reported by: Rahe Owned by:
Milestone: 3.1.1 Priority: normal
Severity: trivial Version: 3.1
Component: Query Keywords: has-patch commit
Focuses: Cc:

Description

Hi,

One of the parameters is overriden in this function ( $meta_type ) and is returned in the filter.

function _get_meta_sql( $meta_query, $meta_type, $primary_table, $primary_id_column, $context = null ) {

and overriden here :

		$meta_type = isset( $q['type'] ) ? strtoupper( $q['type'] ) : 'CHAR';

This bug is blocker when you use the filter :

	return apply_filters_ref_array( 'get_meta_sql', array( compact( 'join', 'where' ), $meta_query, $meta_type, $primary_table, $primary_id_column, &$context ) );

Attachments (2)

mypatch.diff (1.7 KB) - added by Rahe 5 years ago.
Speedy fix
16825.diff (1.5 KB) - added by nacin 5 years ago.

Download all attachments as: .zip

Change History (8)

@Rahe
5 years ago

Speedy fix

#1 @scribu
5 years ago

  • Keywords commit added

#2 @scribu
5 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Owner set to scribu
  • Status changed from new to reviewing

#3 @nacin
5 years ago

  • Milestone changed from Future Release to 3.1.1

@nacin
5 years ago

#4 @scribu
5 years ago

  • Owner scribu deleted

#5 @automattor
5 years ago

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

(In [17530]) Avoid var name conflict in _get_meta_sql(). Fixes type var passed to get_meta_sql filter. Props Rahe, nacin. fixes #16825 for trunk

#6 @ryan
5 years ago

(In [17531]) Avoid var name conflict in _get_meta_sql(). Fixes type var passed to get_meta_sql filter. Props Rahe, nacin. fixes #16825 for 3.1

Note: See TracTickets for help on using tickets.