Changeset 5085

Show
Ignore:
Timestamp:
03/22/07 23:02:32 (1 year ago)
Author:
ryan
Message:

Cast to int

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.1/wp-includes/post.php

    r5083 r5085  
    770770function wp_set_post_categories($post_ID = 0, $post_categories = array()) { 
    771771    global $wpdb; 
     772 
     773    $post_ID = (int) $post_ID; 
    772774    // If $post_categories isn't already an array, make it one: 
    773775    if (!is_array($post_categories) || 0 == count($post_categories) || empty($post_categories)) 
     
    780782        SELECT category_id 
    781783        FROM $wpdb->post2cat 
    782         WHERE post_id = $post_ID"); 
     784        WHERE post_id = '$post_ID'"); 
    783785 
    784786    if (!$old_categories) { 
     
    795797            $wpdb->query(" 
    796798                DELETE FROM $wpdb->post2cat 
    797                 WHERE category_id = $del 
    798                     AND post_id = $post_ID 
     799                WHERE category_id = '$del' 
     800                    AND post_id = '$post_ID' 
    799801                "); 
    800802        }