Changeset 5030

Show
Ignore:
Timestamp:
03/12/07 21:25:19 (1 year ago)
Author:
ryan
Message:

Quote values heading to DB. Cast some ints.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.1/wp-admin/admin-db.php

    r4749 r5030  
    470470    if ($add_cats) { 
    471471        foreach ($add_cats as $new_cat) { 
    472             $wpdb->query(" 
    473                 INSERT INTO $wpdb->link2cat (link_id, category_id) 
    474                 VALUES ($link_ID, $new_cat)"); 
     472            $new_cat = (int) $new_cat; 
     473            if ( !empty($new_cat) ) 
     474                $wpdb->query(" 
     475                    INSERT INTO $wpdb->link2cat (link_id, category_id) 
     476                    VALUES ('$link_ID', '$new_cat')"); 
    475477        } 
    476478    } 
  • branches/2.1/wp-includes/post.php

    r5022 r5030  
    801801    if ($add_cats) { 
    802802        foreach ($add_cats as $new_cat) { 
     803            $new_cat = (int) $new_cat; 
    803804            if ( !empty($new_cat) ) 
    804805                $wpdb->query(" 
    805806                    INSERT INTO $wpdb->post2cat (post_id, category_id)  
    806                     VALUES ($post_ID, $new_cat)"); 
     807                    VALUES ('$post_ID', '$new_cat')"); 
    807808        } 
    808809    }