From cb712c991d1c0eecf982f9a22014ef7ee27df4a3 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 6 Mar 2009 01:06:00 +0000 Subject: [PATCH] Only list field types that are not strings. see #7171 git-svn-id: http://svn.automattic.com/wordpress/trunk@10726 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/wp-db.php | 2 -- wp-settings.php | 13 ++++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 9b0a0b71b4..0e0d7a34b3 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -718,7 +718,6 @@ class wpdb { $formatted_fields[] = $form; } $sql = "INSERT INTO $table (`" . implode( '`,`', $fields ) . "`) VALUES ('" . implode( "','", $formatted_fields ) . "')"; - error_log($sql); return $this->query( $this->prepare( $sql, $data) ); } @@ -764,7 +763,6 @@ class wpdb { } $sql = "UPDATE $table SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ); - error_log($sql); return $this->query( $this->prepare( $sql, array_merge(array_values($data), array_values($where))) ); } diff --git a/wp-settings.php b/wp-settings.php index 8a6266971d..0f14ac4d26 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -247,11 +247,14 @@ require (ABSPATH . WPINC . '/compat.php'); require (ABSPATH . WPINC . '/functions.php'); require (ABSPATH . WPINC . '/classes.php'); -$db_field_types = array( 'post_author' => '%d', 'post_date' => '%s', 'post_date_gmt' => '%s', 'post_content' => '%s', 'post_content_filtered' => '%s', 'post_title' => '%s', - 'post_excerpt' => '%s', 'post_status' => '%s', 'post_type' => '%s', 'comment_status' => '%s', 'ping_status' => '%s', 'post_password' => '%s', 'post_name' => '%s', - 'to_ping' => '%s', 'pinged' => '%s', 'post_modified' => '%s', 'post_modified_gmt' => '%s', 'post_parent' => '%d', 'menu_order' => '%d', 'guid' => '%s', 'term_id' => '%d', - 'name' => '%s', 'slug' => '%s', 'term_group' => '%d', 'term_taxonomy_id' => '%d', 'description' => '%s', 'taxonomy' => '%s', 'parent' => '%d', 'count' => '%d', - 'object_id' => '%d', 'term_order' => '%d'); +/** + * Format specifiers for DB columns. Columns not listed here default to %s. + * @since 2.8.0 + */ +$db_field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d', + 'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d', + 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d', + 'user_status' => '%d', 'umeta_id' => '%d'); require_wp_db();