mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 07:07:38 +02:00
Quote values heading to DB. Cast some ints.
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@5031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4ac2b6d88d
commit
fda7688049
@ -512,9 +512,11 @@ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array(
|
||||
|
||||
if ($add_cats) {
|
||||
foreach ($add_cats as $new_cat) {
|
||||
$new_cat = (int) $new_cat;
|
||||
if ( !empty($new_cat) )
|
||||
$wpdb->query("
|
||||
INSERT INTO $wpdb->post2cat (post_id, category_id)
|
||||
VALUES ($post_ID, $new_cat)");
|
||||
VALUES ('$post_ID', '$new_cat')");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user