From e2e3204fa017da34555591126a3f949deaeb0ad8 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 26 Jun 2005 20:44:58 +0000 Subject: [PATCH] Quote IDs in get queries. git-svn-id: http://svn.automattic.com/wordpress/trunk@2663 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index adcfa8aa6e..ccca1bdf68 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -481,7 +481,7 @@ function &get_post(&$post, $output = OBJECT) { if (isset($post_cache[$post])) $_post = & $post_cache[$post]; else { - $query = "SELECT * FROM $wpdb->posts WHERE ID=$post"; + $query = "SELECT * FROM $wpdb->posts WHERE ID = '$post'"; $post_cache[$post] = & $wpdb->get_row($query); $_post = & $post_cache[$post]; } @@ -518,7 +518,7 @@ function &get_page(&$page, $output = OBJECT) { elseif (isset($page_cache[$page])) $_page = & $page_cache[$page]; else { - $query = "SELECT * FROM $wpdb->posts WHERE ID=$page"; + $query = "SELECT * FROM $wpdb->posts WHERE ID= '$page'"; $page_cache[$page] = & $wpdb->get_row($query); $_page = & $page_cache[$page]; } @@ -552,7 +552,7 @@ function &get_category(&$category, $output = OBJECT) { $_category = & $cache_categories[$category->cat_ID]; } else { if ( !isset($cache_categories[$category]) ) { - $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = $category"); + $_category = $wpdb->get_row("SELECT * FROM $wpdb->categories WHERE cat_ID = '$category'"); $cache_categories[$category->cat_ID] = & $_category; } else { $_category = & $cache_categories[$category];