summaryrefslogtreecommitdiffstats
path: root/wp-includes/link-template.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-30 16:49:38 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-30 16:49:38 +0000
commitd85d717aedbc7690e2a450e40dab8fcebd94b38c (patch)
treea7340a14bb1192e977fca4f26beef29869e17579 /wp-includes/link-template.php
parent9817ff2d282c68faaa09232845829b96f207e72b (diff)
downloadwordpress-mu-d85d717aedbc7690e2a450e40dab8fcebd94b38c.tar.gz
wordpress-mu-d85d717aedbc7690e2a450e40dab8fcebd94b38c.tar.xz
wordpress-mu-d85d717aedbc7690e2a450e40dab8fcebd94b38c.zip
Merge with WordPress 2.3.1
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1139 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/link-template.php')
-rw-r--r--wp-includes/link-template.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index c3b7ed7..6a0677b 100644
--- a/wp-includes/link-template.php
+++ b/wp-includes/link-template.php
@@ -367,9 +367,9 @@ function get_previous_post($in_same_cat = false, $excluded_categories = '') {
if ( $in_same_cat ) {
$join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id ";
$cat_array = wp_get_object_terms($post->ID, 'category', 'fields=tt_ids');
- $join .= $wpdb->prepare(' AND (tr.term_taxonomy_id = %d', $cat_array[0]);
+ $join .= ' AND (tr.term_taxonomy_id = ' . intval($cat_array[0]);
for ( $i = 1; $i < (count($cat_array)); $i++ ) {
- $join .= $wpdb->prepare(' OR tr.term_taxonomy_id = %d', $cat_array[$i]);
+ $join .= ' OR tr.term_taxonomy_id = ' . intval($cat_array[$i]);
}
$join .= ')';
}
@@ -382,7 +382,7 @@ function get_previous_post($in_same_cat = false, $excluded_categories = '') {
}
$join = apply_filters( 'get_previous_post_join', $join, $in_same_cat, $excluded_categories );
- $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 );
+ $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 );
$sort = apply_filters( 'get_previous_post_sort', 'ORDER BY p.post_date DESC LIMIT 1' );
return @$wpdb->get_row("SELECT p.ID, p.post_title FROM $wpdb->posts AS p $join $where $sort");
@@ -400,9 +400,9 @@ function get_next_post($in_same_cat = false, $excluded_categories = '') {
if ( $in_same_cat ) {
$join = " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id ";
$cat_array = wp_get_object_terms($post->ID, 'category', 'fields=tt_ids');
- $join .= $wpdb->prepare(' AND (tr.term_taxonomy_id = %d', $cat_array[0]);
+ $join .= ' AND (tr.term_taxonomy_id = ' . intval($cat_array[0]);
for ( $i = 1; $i < (count($cat_array)); $i++ ) {
- $join .= $wpdb->prepare(' OR tr.term_taxonomy_id = $d', $cat_array[$i]);
+ $join .= ' OR tr.term_taxonomy_id = ' . intval($cat_array[$i]);
}
$join .= ')';
}
@@ -415,7 +415,7 @@ function get_next_post($in_same_cat = false, $excluded_categories = '') {
}
$join = apply_filters( 'get_next_post_join', $join, $in_same_cat, $excluded_categories );
- $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 );
+ $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 );
$sort = apply_filters( 'get_next_post_sort', 'ORDER BY p.post_date ASC LIMIT 1' );
return @$wpdb->get_row("SELECT p.ID, p.post_title FROM $wpdb->posts AS p $join $where $sort");