Changeset 6180 for trunk/wp-includes/link-template.php
- Timestamp:
- 10/02/2007 06:45:47 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/link-template.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r6152 r6180 368 368 $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id "; 369 369 $cat_array = wp_get_object_terms($post->ID, 'category', 'fields=tt_ids'); 370 $join .= ' AND (tr.term_taxonomy_id = ' . intval($cat_array[0]);370 $join .= $wpdb->prepare(' AND (tr.term_taxonomy_id = %d', $cat_array[0]); 371 371 for ( $i = 1; $i < (count($cat_array)); $i++ ) { 372 $join .= ' OR tr.term_taxonomy_id = ' . intval($cat_array[$i]);372 $join .= $wpdb->prepare(' OR tr.term_taxonomy_id = %d', $cat_array[$i]); 373 373 } 374 374 $join .= ')'; … … 383 383 384 384 $join = apply_filters( 'get_previous_post_join', $join, $in_same_cat, $excluded_categories ); 385 $where = apply_filters( 'get_previous_post_where', "WHERE p.post_date < '$current_post_date' AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql", $in_same_cat, $excluded_categories );385 $where = apply_filters( 'get_previous_post_where', $wpdb->prepare("WHERE p.post_date < %s AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql", $current_post_date), $in_same_cat, $excluded_categories ); 386 386 $sort = apply_filters( 'get_previous_post_sort', 'ORDER BY p.post_date DESC LIMIT 1' ); 387 387 … … 401 401 $join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id "; 402 402 $cat_array = wp_get_object_terms($post->ID, 'category', 'fields=tt_ids'); 403 $join .= ' AND (tr.term_taxonomy_id = ' . intval($cat_array[0]);403 $join .= $wpdb->prepare(' AND (tr.term_taxonomy_id = %d', $cat_array[0]); 404 404 for ( $i = 1; $i < (count($cat_array)); $i++ ) { 405 $join .= ' OR tr.term_taxonomy_id = ' . intval($cat_array[$i]);405 $join .= $wpdb->prepare(' OR tr.term_taxonomy_id = $d', $cat_array[$i]); 406 406 } 407 407 $join .= ')'; … … 416 416 417 417 $join = apply_filters( 'get_next_post_join', $join, $in_same_cat, $excluded_categories ); 418 $where = apply_filters( 'get_next_post_where', "WHERE p.post_date > '$current_post_date' AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql AND p.ID != $post->ID", $in_same_cat, $excluded_categories );418 $where = apply_filters( 'get_next_post_where', $wpdb->prepare("WHERE p.post_date > %s AND p.post_type = 'post' AND p.post_status = 'publish' $posts_in_ex_cats_sql AND p.ID != %d", $current_post_date, $post->ID), $in_same_cat, $excluded_categories ); 419 419 $sort = apply_filters( 'get_next_post_sort', 'ORDER BY p.post_date ASC LIMIT 1' ); 420 420
Note: See TracChangeset
for help on using the changeset viewer.