Changeset 4735
- Timestamp:
- 01/29/2013 07:27:55 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/common/functions.php
r4701 r4735 682 682 $join = $clauses['join']; 683 683 $where = $clauses['where']; 684 } else {684 } else { 685 685 $join = $where = ''; 686 686 } … … 688 688 // Simple duplicate check 689 689 // Expected slashed ($post_type, $post_parent, $post_author, $post_content, $anonymous_data) 690 $query = "SELECT ID FROM {$wpdb->posts} {$join} WHERE post_type = '{$r['post_type']}' AND post_status != '{$r['post_status']}' AND post_author = {$r['post_author']} AND post_content = '{$r['post_content']}' {$where}";691 $query .= !empty( $r['post_parent'] ) ? " AND post_parent = '{$r['post_parent']}'": '';690 $query = $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} {$join} WHERE post_type = '%s' AND post_status != '%s' AND post_author = '%d' AND post_content = '%s' {$where}", $r['post_type'], $r['post_status'], $r['post_author'], $r['post_content'] ); 691 $query .= !empty( $r['post_parent'] ) ? $wpdb->prepare( " AND post_parent = '%d'", $r['post_parent'] ) : ''; 692 692 $query .= " LIMIT 1"; 693 693 $dupe = apply_filters( 'bbp_check_for_duplicate_query', $query, $r );
Note: See TracChangeset
for help on using the changeset viewer.