diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-30 16:49:38 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-10-30 16:49:38 +0000 |
commit | d85d717aedbc7690e2a450e40dab8fcebd94b38c (patch) | |
tree | a7340a14bb1192e977fca4f26beef29869e17579 /wp-includes/canonical.php | |
parent | 9817ff2d282c68faaa09232845829b96f207e72b (diff) | |
download | wordpress-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/canonical.php')
-rw-r--r-- | wp-includes/canonical.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 7c7c909..9226f3e 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -180,15 +180,15 @@ function redirect_guess_404_permalink() { if ( !get_query_var('name') ) return false; - $where = $wpdb->prepare("post_name LIKE %s", get_query_var('name') . '%'); + $where = "post_name LIKE '" . $wpdb->escape(get_query_var('name')) . "%'"; // if any of year, monthnum, or day are set, use them to refine the query if ( get_query_var('year') ) - $where .= $wpdb->prepare(" AND YEAR(post_date) = %d", get_query_var('year')); + $where .= " AND YEAR(post_date) = '" . $wpdb->escape(get_query_var('year')) . "'"; if ( get_query_var('monthnum') ) - $where .= $wpdb->prepare(" AND MONTH(post_date) = %d", get_query_var('monthnum')); + $where .= " AND MONTH(post_date) = '" . $wpdb->escape(get_query_var('monthnum')) . "'"; if ( get_query_var('day') ) - $where .= $wpdb->prepare(" AND DAYOFMONTH(post_date) = %d", get_query_var('day')); + $where .= " AND DAYOFMONTH(post_date) = '" . $wpdb->escape(get_query_var('day')) . "'"; $post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE $where AND post_status = 'publish'"); if ( !$post_id ) |