WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#7073 closed defect (bug) (fixed)

Another ambiguous column in query.php method get_posts()

Reported by: voxpelli Owned by:
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5.1
Component: General Keywords: has-patch needs-testing
Focuses: Cc:

Description

In the latest trunk the line 931 in query.php should be:

$where .= " AND ($wpdb->posts.ID = '$reqpage')";

This bug also exists in v2.5.1

Background: A plugin of mine uses the filters posts_fields, posts_where and post_join and the field ID exists in the joined table which today will cause the query to fail because it writes (ID = '53') in the where-clause which confuses MySQL - it should be (wp_posts.ID = '53').

Attachments (1)

7073.diff (605 bytes) - added by voxpelli 6 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 voxpelli6 years ago

With the latest trunk - I mean: revision 8030

comment:2 DD326 years ago

  • Keywords needs-patch added
  • Milestone set to 2.6

voxpelli6 years ago

comment:3 voxpelli6 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

comment:4 ryan6 years ago

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

(In [8185]) Disambiguate column. Props voxpelli. fixes #7073

Note: See TracTickets for help on using tickets.