Changeset 5086

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

Cast to int

Files:

Legend:

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

    r5082 r5086  
    461461 
    462462    // Set the limit clause, if we got a limit 
     463    $num = (int) $num; 
    463464    if ($num) { 
    464465        $limit = "LIMIT $num"; 
     
    771772function wp_set_post_categories($post_ID = 0, $post_categories = array()) { 
    772773    global $wpdb; 
     774 
     775    $post_ID = (int) $post_ID; 
    773776    // If $post_categories isn't already an array, make it one: 
    774777    if (!is_array($post_categories) || 0 == count($post_categories) || empty($post_categories)) 
     
    781784        SELECT category_id 
    782785        FROM $wpdb->post2cat 
    783         WHERE post_id = $post_ID"); 
     786        WHERE post_id = '$post_ID'"); 
    784787 
    785788    if (!$old_categories) { 
     
    796799            $wpdb->query(" 
    797800                DELETE FROM $wpdb->post2cat 
    798                 WHERE category_id = $del 
    799                     AND post_id = $post_ID 
     801                WHERE category_id = '$del' 
     802                    AND post_id = '$post_ID' 
    800803                "); 
    801804        }