Make WordPress Core


Ignore:
Timestamp:
03/25/2007 11:06:28 PM (19 years ago)
Author:
ryan
Message:

Some int casts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-admin/admin-db.php

    r4365 r5099  
    111111        if (!$update) {
    112112                $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent')");
    113                 $cat_ID = $wpdb->insert_id;
     113                $cat_ID = (int) $wpdb->insert_id;
    114114        } else {
    115115                $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'");
     
    208208                return 0;
    209209
    210         return $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'");
     210        return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'");
    211211}
    212212
     
    270270        if ( !empty($link_id) )
    271271                $update = true;
     272
     273        $link_id = (int) $link_id;
    272274
    273275        if( trim( $link_name ) == '' )
     
    327329        } else {
    328330                $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_category', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')");
    329                 $link_id = $wpdb->insert_id;
     331                $link_id = (int) $wpdb->insert_id;
    330332        }
    331333       
Note: See TracChangeset for help on using the changeset viewer.