Changeset 5087

Show
Ignore:
Timestamp:
03/23/07 00:59:21 (1 year ago)
Author:
matt
Message:

(int)er the dragon.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/app.php

    r5000 r5087  
    418418            $this->auth_required('Sorry, you do not have the right to edit/publish new posts.'); 
    419419 
    420         $blog_ID = $current_blog->blog_id; 
     420        $blog_ID = (int )$current_blog->blog_id; 
    421421        $post_status = ($publish) ? 'publish' : 'draft'; 
    422         $post_author = $user->ID; 
     422        $post_author = (int) $user->ID; 
    423423        $post_title = $entry->title; 
    424424        $post_content = $entry->content; 
     
    431431        log_app('Inserting Post. Data:', print_r($post_data,true)); 
    432432 
    433         $postID = wp_insert_post($post_data); 
     433        $postID = (int) wp_insert_post($post_data); 
    434434 
    435435        if (!$postID) { 
     
    583583 
    584584        // Save the data 
    585         $postID = wp_insert_attachment($attachment, $file, $post); 
     585        $postID = (int) wp_insert_attachment($attachment, $file, $post); 
    586586 
    587587        if (!$postID) { 
     
    789789        if(!isset($postID)) { 
    790790            global $post; 
    791             $postID = $GLOBALS['post']->ID; 
     791            $postID = (int) $GLOBALS['post']->ID; 
    792792        } 
    793793 
     
    811811        if(!isset($postID)) { 
    812812            global $post; 
    813             $postID = $GLOBALS['post']->ID; 
     813            $postID = (int) $GLOBALS['post']->ID; 
    814814        } 
    815815 
     
    886886        $wp_query = $GLOBALS['wp_query']; 
    887887        $wpdb = $GLOBALS['wpdb']; 
    888         $blog_id = $GLOBALS['blog_id']; 
     888        $blog_id = (int) $GLOBALS['blog_id']; 
    889889        $post_cache = $GLOBALS['post_cache']; 
    890890 
  • trunk/wp-admin/admin-ajax.php

    r4953 r5087  
    116116        if ( !$category_nicename = sanitize_title($cat_name) ) 
    117117            die('0'); 
    118         if ( !$cat_id = category_exists( $cat_name ) ) 
    119             $cat_id = wp_create_category( $cat_name ); 
     118        if ( !$cat_id = (int) category_exists( $cat_name ) ) 
     119            $cat_id = (int) wp_create_category( $cat_name ); 
    120120        $cat_name = wp_specialchars(stripslashes($cat_name)); 
    121121        $x->add( array( 
     
    157157    if ( $id < 0 ) { 
    158158        $now = current_time('timestamp', 1); 
    159         if ( $pid = wp_insert_post( array( 
     159        if ( $pid = (int) wp_insert_post( array( 
    160160            'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)) 
    161161        ) ) ) 
    162             $mid = add_meta( $pid ); 
     162            $mid = (int) add_meta( $pid ); 
    163163        else 
    164164            die('0'); 
    165     } else if ( !$mid = add_meta( $id ) ) { 
     165    } else if ( !$mid = (int) add_meta( $id ) ) { 
    166166        die('0'); 
    167167    } 
     
    205205        die('-1'); 
    206206    require_once(ABSPATH . WPINC . '/registration.php'); 
    207     if ( !$user_id = add_user() ) 
     207    if ( !$user_id = (int) add_user() ) 
    208208        die('0'); 
    209209    elseif ( is_wp_error( $user_id ) ) { 
     
    231231    if($_POST['post_ID'] < 0) { 
    232232        $_POST['temp_ID'] = $_POST['post_ID']; 
    233         $id = wp_write_post(); 
     233        $id = (int) wp_write_post(); 
    234234        if(is_wp_error($id)) 
    235235            die($id->get_error_message()); 
  • trunk/wp-admin/admin-db.php

    r5029 r5087  
    124124    if (!$update) { 
    125125        $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_description, category_parent, links_private, posts_private) VALUES ('0', '$cat_name', '$category_nicename', '$category_description', '$category_parent', '$links_private', '$posts_private')"); 
    126         $cat_ID = $wpdb->insert_id; 
     126        $cat_ID = (int) $wpdb->insert_id; 
    127127    } else { 
    128128        $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent', links_private = '$links_private', posts_private = '$posts_private' WHERE cat_ID = '$cat_ID'"); 
     
    361361    } else { 
    362362        $wpdb->query("INSERT INTO $wpdb->links (link_url, link_name, link_image, link_target, link_description, link_visible, link_owner, link_rating, link_rel, link_notes, link_rss) VALUES('$link_url','$link_name', '$link_image', '$link_target', '$link_description', '$link_visible', '$link_owner', '$link_rating', '$link_rel', '$link_notes', '$link_rss')"); 
    363         $link_id = $wpdb->insert_id; 
     363        $link_id = (int) $wpdb->insert_id; 
    364364    } 
    365365 
  • trunk/wp-admin/admin-functions.php

    r5072 r5087  
    115115    if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) 
    116116        $draft_ids = array(); 
    117     if ( $draft_temp_id = array_search( $post_ID, $draft_ids ) ) 
     117    if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) 
    118118        relocate_children( $draft_temp_id, $post_ID ); 
    119119    if ( $temp_id && $temp_id != $draft_temp_id ) 
     
    158158            continue; 
    159159 
    160         $id = $id_matches[3]; 
     160        $id = (int) $id_matches[3]; 
    161161 
    162162        // While we have the attachment ID, let's adopt any orphans. 
     
    291291    if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) 
    292292        $draft_ids = array(); 
    293     if ( $draft_temp_id = array_search( $post_ID, $draft_ids ) ) 
     293    if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) 
    294294        relocate_children( $draft_temp_id, $post_ID ); 
    295295 
     
    448448    if ( func_num_args() ) { // The hackiest hack that ever did hack 
    449449        global $current_user, $wp_roles; 
    450         $user_id = func_get_arg( 0 ); 
     450        $user_id = (int) func_get_arg( 0 ); 
    451451 
    452452        if ( isset( $_POST['role'] ) ) { 
     
    466466    if ( $user_id != 0 ) { 
    467467        $update = true; 
    468         $user->ID = $user_id; 
     468        $user->ID = (int) $user_id; 
    469469        $userdata = get_userdata( $user_id ); 
    470470        $user->user_login = $wpdb->escape( $userdata->user_login ); 
     
    563563 
    564564    if ( $update ) { 
    565         $user_id = wp_update_user( get_object_vars( $user )); 
    566     } else { 
    567         $user_id = wp_insert_user( get_object_vars( $user )); 
     565        $user_id = (int) wp_update_user( get_object_vars( $user )); 
     566    } else { 
     567        $user_id = (int) wp_insert_user( get_object_vars( $user )); 
    568568        wp_new_user_notification( $user_id ); 
    569569    } 
     
    794794    if ( current_user_can( 'manage_categories' ) ) { 
    795795        $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>".__( 'Edit' )."</a></td>"; 
    796         $default_cat_id = get_option( 'default_category' ); 
    797         $default_link_cat_id = get_option( 'default_link_category' ); 
     796        $default_cat_id = (int) get_option( 'default_category' ); 
     797        $default_link_cat_id = (int) get_option( 'default_link_category' ); 
    798798 
    799799        if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) ) 
     
    834834        $post->post_title = wp_specialchars( $post->post_title ); 
    835835        $pad = str_repeat( '&#8212; ', $level ); 
    836         $id = $post->ID; 
     836        $id = (int) $post->ID; 
    837837        $class = ('alternate' == $class ) ? '' : 'alternate'; 
    838838?> 
     
    19701970 
    19711971    // Save the data 
    1972     $id = wp_insert_attachment( $object, $file ); 
     1972    $id = (int) wp_insert_attachment( $object, $file ); 
    19731973 
    19741974    return array( 'file' => $file, 'id' => $id ); 
  • trunk/wp-admin/custom-header.php

    r5007 r5087  
    216216 
    217217        // Save the data 
    218         $id = wp_insert_attachment($object, $file); 
     218        $id = (int) wp_insert_attachment($object, $file); 
    219219 
    220220        $upload = array('file' => $file, 'id' => $id); 
  • trunk/wp-admin/edit-comments.php

    r5056 r5087  
    5757    foreach ($_POST['delete_comments'] as $comment) : // Check the permissions on each 
    5858        $comment = (int) $comment; 
    59         $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); 
     59        $post_id = (int) $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); 
    6060        // $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); 
    6161        if ( current_user_can('edit_post', $post_id) ) { 
  • trunk/wp-admin/import/blogger.php

    r5038 r5087  
    547547        } 
    548548 
    549         $comment_post_ID = $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink]; 
     549        $comment_post_ID = (int) $this->blogs[$importing_blog]['posts'][$entry->old_post_permalink]; 
    550550        preg_match('#<name>(.+?)</name>.*(?:\<uri>(.+?)</uri>)?#', $entry->author, $matches); 
    551551        $comment_author  = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) ); 
  • trunk/wp-admin/import/blogware.php

    r4495 r5087  
    105105 
    106106            if ( $comments ) { 
    107                 $comment_post_ID = $post_id; 
     107                $comment_post_ID = (int) $post_id; 
    108108                $num_comments = 0; 
    109109                foreach ($comments as $comment) { 
  • trunk/wp-admin/import/dotclear.php

    r4608 r5087  
    438438 
    439439                // WordPressify Data 
    440                 $comment_ID = ltrim($comment_id, '0'); 
    441                 $comment_post_ID = $postarr[$post_id]; 
     440                $comment_ID = (int) ltrim($comment_id, '0'); 
     441                $comment_post_ID = (int) $postarr[$post_id]; 
    442442                $comment_approved = "$comment_pub"; 
    443443                $name = $wpdb->escape(csc ($comment_auteur)); 
  • trunk/wp-admin/import/livejournal.php

    r4608 r5087  
    8383 
    8484            if ( $comments ) { 
    85                 $comment_post_ID = $post_id; 
     85                $comment_post_ID = (int) $post_id; 
    8686                $num_comments = 0; 
    8787                foreach ($comments as $comment) { 
  • trunk/wp-admin/import/mt.php

    r4608 r5087  
    172172        } 
    173173        $this->file = $file['file']; 
    174         $this->id = $file['id']; 
     174        $this->id = (int) $file['id']; 
    175175 
    176176        $this->get_entries(); 
     
    296296                } 
    297297 
    298                 $comment_post_ID = $post_id; 
     298                $comment_post_ID = (int) $post_id; 
    299299                $comment_approved = 1; 
    300300 
  • trunk/wp-admin/import/wordpress.php

    r4742 r5087  
    175175        } 
    176176        $this->file = $file['file']; 
    177         $this->id = $file['id']; 
     177        $this->id = (int) $file['id']; 
    178178 
    179179        $this->get_entries(); 
  • trunk/wp-comments-post.php

    r5039 r5087  
    5555$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID'); 
    5656 
    57 $comment_id = wp_new_comment( $commentdata ); 
     57$comment_id = (int) wp_new_comment( $commentdata ); 
    5858 
    5959$comment = get_comment($comment_id); 
  • trunk/wp-includes/author-template.php

    r4656 r5087  
    145145function get_author_posts_url($author_id, $author_nicename = '') { 
    146146    global $wpdb, $wp_rewrite, $post, $cache_userdata; 
    147     $auth_ID = $author_id; 
     147    $auth_ID = (int) $author_id; 
    148148    $link = $wp_rewrite->get_author_permastruct(); 
    149149 
  • trunk/wp-includes/bookmark-template.php

    r5056 r5087  
    166166        return ''; 
    167167 
    168     $cat_id = $cats[0]; // Take the first cat. 
     168    $cat_id = (int)  
     169    $cats[0]; // Take the first cat. 
    169170 
    170171    $cat = get_category($cat_id); 
  • trunk/wp-includes/category-template.php

    r5082 r5087  
    6565    $id = (int) $id; 
    6666    if ( !$id ) 
    67         $id = $post->ID; 
     67        $id = (int)  
     68        $post->ID; 
    6869 
    6970    if ( !isset($category_cache[$blog_id][$id]) ) 
  • trunk/wp-includes/comment-template.php

    r5039 r5087  
    151151 
    152152    if ( !$post_id ) 
    153         $post_id = $id; 
     153        $post_id = (int) $id; 
    154154 
    155155    $post = get_post($post_id); 
  • trunk/wp-includes/comment.php

    r5056 r5087  
    346346    "); 
    347347 
    348     $id = $wpdb->insert_id; 
     348    $id = (int) $wpdb->insert_id; 
    349349 
    350350    if ( $comment_approved == 1) 
     
    393393    $commentdata['comment_approved'] = wp_allow_comment($commentdata); 
    394394 
    395     $comment_ID = wp_insert_comment($commentdata); 
     395    $comment_ID = (int) wp_insert_comment($commentdata); 
    396396 
    397397    do_action('comment_post', $comment_ID, $commentdata['comment_approved']); 
  • trunk/wp-includes/feed.php

    r5019 r5087  
    107107 
    108108function get_author_rss_link($echo = false, $author_id, $author_nicename) { 
    109     $auth_ID = $author_id; 
     109    $auth_ID = (int) $author_id; 
    110110    $permalink_structure = get_option('permalink_structure'); 
    111111 
  • trunk/wp-includes/functions.php

    r5056 r5087  
    647647    $count = count( $post_id_array); 
    648648    for ( $i = 0; $i < $count; $i++ ) { 
    649         $post_id = $post_id_array[ $i ]; 
     649        $post_id = (int) $post_id_array[ $i ]; 
    650650        if ( isset( $category_cache[$blog_id][$post_id] ) ) { 
    651651            unset( $post_id_array[ $i ] ); 
     
    701701    $count = count( $post_id_array); 
    702702    for ( $i = 0; $i < $count; $i++ ) { 
    703         $post_id = $post_id_array[ $i ]; 
     703        $post_id = (int) $post_id_array[ $i ]; 
    704704        if ( isset( $post_meta_cache[$blog_id][$post_id] ) ) { // If the meta is already cached 
    705705            unset( $post_id_array[ $i ] ); 
  • trunk/wp-includes/link-template.php

    r5078 r5087  
    120120    $id = (int) $id; 
    121121    if ( !$id ) 
    122         $id = $post->ID; 
     122        $id = (int) $post->ID; 
    123123 
    124124    if ( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) 
     
    135135 
    136136    if ( !$id ) 
    137         $id = $post->ID; 
     137        $id = (int) $post->ID; 
    138138 
    139139    $pagestruct = $wp_rewrite->get_page_permastruct(); 
     
    157157 
    158158    if (! $id) { 
    159         $id = $post->ID; 
     159        $id = (int) $post->ID; 
    160160    } 
    161161 
     
    260260 
    261261    if ( empty($post_id) ) 
    262         $post_id = $id; 
     262        $post_id = (int) $id; 
    263263 
    264264    if ( '' != get_option('permalink_structure') ) { 
  • trunk/wp-includes/pluggable.php

    r5061 r5087  
    526526function wp_verify_nonce($nonce, $action = -1) { 
    527527    $user = wp_get_current_user(); 
    528     $uid = $user->id; 
     528    $uid = (int) $user->id; 
    529529 
    530530    $i = ceil(time() / 43200); 
     
    540540function wp_create_nonce($action = -1) { 
    541541    $user = wp_get_current_user(); 
    542     $uid = $user->id; 
     542    $uid = (int) $user->id; 
    543543 
    544544    $i = ceil(time() / 43200); 
  • trunk/wp-includes/post.php

    r5086 r5087  
    376376 
    377377    if ( !$post_id ) 
    378         $post_id = $id; 
     378        $post_id = (int) $id; 
    379379 
    380380    $post_id = (int) $post_id; 
     
    540540    // Get the post ID. 
    541541    if ( $update ) 
    542         $post_ID = $ID; 
     542        $post_ID = (int) $ID; 
    543543 
    544544    // Create a valid post name.  Drafts are allowed to have an empty 
     
    12571257    if ( !empty($ID) ) { 
    12581258        $update = true; 
    1259         $post_ID = $ID; 
     1259        $post_ID = (int) $ID; 
    12601260    } 
    12611261 
     
    15071507        if ( !$post =& get_post( $mime ) ) 
    15081508            return false; 
    1509         $post_id = $post->ID; 
     1509        $post_id = (int) $post->ID; 
    15101510        $mime = $post->post_mime_type; 
    15111511    } 
  • trunk/wp-includes/query.php

    r5002 r5087  
    588588            $this->queried_object =& get_page_by_path($qv['pagename']); 
    589589            if ( !empty($this->queried_object) ) 
    590                 $this->queried_object_id = $this->queried_object->ID; 
     590                $this->queried_object_id = (int) $this->queried_object->ID; 
    591591            else 
    592592                unset($this->queried_object); 
     
    12061206            $category = &get_category($cat); 
    12071207            $this->queried_object = &$category; 
    1208             $this->queried_object_id = $cat; 
     1208            $this->queried_object_id = (int) $cat; 
    12091209        } else if ($this->is_posts_page) { 
    12101210            $this->queried_object = & get_page(get_option('page_for_posts')); 
    1211             $this->queried_object_id = $this->queried_object->ID; 
     1211            $this->queried_object_id = (int) $this->queried_object->ID; 
    12121212        } else if ($this->is_single) { 
    12131213            $this->queried_object = $this->post; 
    1214             $this->queried_object_id = $this->post->ID; 
     1214            $this->queried_object_id = (int) $this->post->ID; 
    12151215        } else if ($this->is_page) { 
    12161216            $this->queried_object = $this->post; 
    1217             $this->queried_object_id = $this->post->ID; 
     1217            $this->queried_object_id = (int) $this->post->ID; 
    12181218        } else if ($this->is_author) { 
    1219             $author_id = $this->get('author'); 
     1219            $author_id = (int) $this->get('author'); 
    12201220            $author = get_userdata($author_id); 
    12211221            $this->queried_object = $author; 
     
    12861286    global $pagenow; 
    12871287 
    1288     $id = $post->ID; 
     1288    $id = (int) $post->ID; 
    12891289 
    12901290    $authordata = get_userdata($post->post_author); 
  • trunk/wp-includes/registration.php

    r4651 r5087  
    9090        $query = apply_filters('update_user_query', $query); 
    9191        $wpdb->query( $query ); 
    92         $user_id = $ID; 
     92        $user_id = (int) $ID; 
    9393    } else { 
    9494        $query = "INSERT INTO $wpdb->users 
     
    9898        $query = apply_filters('create_user_query', $query); 
    9999        $wpdb->query( $query ); 
    100         $user_id = $wpdb->insert_id; 
     100        $user_id = (int) $wpdb->insert_id; 
    101101    } 
    102102 
  • trunk/wp-includes/theme.php

    r5028 r5087  
    347347    global $wp_query; 
    348348 
    349     $id = $wp_query->post->ID; 
     349    $id = (int) $wp_query->post->ID; 
    350350    $template = get_post_meta($id, '_wp_page_template', true); 
    351351 
  • trunk/wp-includes/user.php

    r5037 r5087  
    5757    global $wpdb, $blog_id; 
    5858    if ( empty($id) ) 
    59         $id = $blog_id; 
     59        $id = (int) $blog_id; 
    6060    $users = $wpdb->get_results( "SELECT user_id, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE " . $wpdb->users . ".ID = " . $wpdb->usermeta . ".user_id AND meta_key = '" . $wpdb->prefix . "capabilities' ORDER BY {$wpdb->usermeta}.user_id" ); 
    6161    return $users; 
     
    172172    $userdata = $user->data; 
    173173    $user_login = $user->user_login; 
    174     $user_level = $user->user_level; 
    175     $user_ID    = $user->ID; 
     174    $user_level = (int) $user->user_level; 
     175    $user_ID    = (int) $user->ID; 
    176176    $user_email = $user->user_email; 
    177177    $user_url   = $user->user_url; 
  • trunk/wp-login.php

    r5064 r5087  
    243243            $user_pass = substr( md5( uniqid( microtime() ) ), 0, 7); 
    244244 
    245             $user_id = wp_create_user( $user_login, $user_pass, $user_email ); 
     245            $user_id = (int) wp_create_user( $user_login, $user_pass, $user_email ); 
    246246            if ( !$user_id ) 
    247247                $errors['registerfail'] = sprintf(__('<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_option('admin_email')); 
  • trunk/wp-mail.php

    r4144 r5087  
    137137    $post_data = add_magic_quotes($post_data); 
    138138 
    139     $post_ID = wp_insert_post($post_data); 
     139    $post_ID = (int) wp_insert_post($post_data); 
    140140 
    141141    if (!$post_ID) { 
  • trunk/wp-trackback.php

    r4801 r5087  
    8585    } 
    8686 
    87     $comment_post_ID = $tb_id; 
     87    $comment_post_ID = (int) $tb_id; 
    8888    $comment_author = $blog_name; 
    8989    $comment_author_email = ''; 
  • trunk/xmlrpc.php

    r5082 r5087  
    173173        $this->escape($args); 
    174174 
    175         $blog_id    = $args[0]; 
    176         $page_id    = $args[1]; 
     175        $blog_id    = (int) $args[0]; 
     176        $page_id    = (int) $args[1]; 
    177177        $username   = $args[2]; 
    178178        $password   = $args[3]; 
     
    253253        $this->escape($args); 
    254254 
    255         $blog_id    = $args[0]; 
     255        $blog_id    = (int) $args[0]; 
    256256        $username   = $args[1]; 
    257257        $password   = $args[2]; 
     
    321321        $this->escape($args); 
    322322 
    323         $blog_id    = $args[0]; 
     323        $blog_id    = (int) $args[0]; 
    324324        $username   = $args[1]; 
    325325        $password   = $args[2]; 
    326         $page_id    = $args[3]; 
     326        $page_id    = (int) $args[3]; 
    327327 
    328328        if(!$this->login_pass_ok($username, $password)) { 
     
    361361    function wp_editPage($args) { 
    362362        // Items not escaped here will be escaped in editPost. 
    363         $blog_id    = $args[0]; 
     363        $blog_id    = (int) $args[0]; 
    364364        $page_id    = $this->escape((int) $args[1]); 
    365365        $username   = $this->escape($args[2]); 
     
    412412        $this->escape($args); 
    413413 
    414         $blog_id                = $args[0]; 
     414        $blog_id                = (int) $args[0]; 
    415415        $username               = $args[1]; 
    416416        $password               = $args[2]; 
     
    452452        $this->escape($args); 
    453453 
    454         $blog_id    = $args[0]; 
     454        $blog_id    = (int) $args[0]; 
    455455        $username   = $args[1]; 
    456456        $password   = $args[2]; 
     
    470470        $this->escape($args); 
    471471 
    472         $blog_id                = $args[0]; 
     472        $blog_id                = (int) $args[0]; 
    473473        $username               = $args[1]; 
    474474        $password               = $args[2]; 
     
    513513        ); 
    514514 
    515         $cat_id = wp_insert_category($new_category); 
     515        $cat_id = (int) wp_insert_category($new_category); 
    516516        if(!$cat_id) { 
    517517            return(new IXR_Error(500, "Sorry, the new category failed.")); 
     
    530530        $this->escape($args); 
    531531 
    532         $blog_id                = $args[0]; 
     532        $blog_id                = (int) $args[0]; 
    533533        $username               = $args[1]; 
    534534        $password               = $args[2]; 
     
    621621        $this->escape($args); 
    622622 
    623         $post_ID    = $args[1]; 
     623        $post_ID    = (int) $args[1]; 
    624624        $user_login = $args[2]; 
    625625        $user_pass  = $args[3]; 
     
    656656        $this->escape($args); 
    657657 
    658         $blog_ID    = $args[1]; /* though we don't use it yet */ 
     658        $blog_ID    = (int) $args[1]; /* though we don't use it yet */ 
    659659        $user_login = $args[2]; 
    660660        $user_pass  = $args[3]; 
     
    704704        $this->escape($args); 
    705705 
    706       $blog_ID    = $args[1]; 
     706      $blog_ID    = (int) $args[1]; 
    707707      $user_login = $args[2]; 
    708708      $user_pass  = $args[3]; 
     
    738738        $this->escape($args); 
    739739 
    740       $blog_ID    = $args[1]; 
     740      $blog_ID    = (int) $args[1]; 
    741741      $user_login = $args[2]; 
    742742      $user_pass  = $args[3]; 
     
    775775        $this->escape($args); 
    776776 
    777       $blog_ID    = $args[1]; /* though we don't use it yet */ 
     777      $blog_ID    = (int) $args[1]; /* though we don't use it yet */ 
    778778      $user_login = $args[2]; 
    779779      $user_pass  = $args[3]; 
     
    803803      $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status'); 
    804804 
    805       $post_ID = wp_insert_post($post_data); 
     805      $post_ID = (int) wp_insert_post($post_data); 
    806806 
    807807      if (!$post_ID) { 
     
    874874        $this->escape($args); 
    875875 
    876       $post_ID     = $args[1]; 
     876      $post_ID     = (int) $args[1]; 
    877877      $user_login  = $args[2]; 
    878878      $user_pass   = $args[3]; 
     
    915915        $this->escape($args); 
    916916 
    917       $blog_ID     = $args[0]; // we will support this in the near future 
     917      $blog_ID     = (int) $args[0]; // we will support this in the near future 
    918918      $user_login  = $args[1]; 
    919919      $user_pass   = $args[2]; 
     
    10311031      $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order'); 
    10321032 
    1033       $post_ID = wp_insert_post($postdata); 
     1033      $post_ID = (int) wp_insert_post($postdata); 
    10341034 
    10351035      if (!$post_ID) { 
     
    12171217        $this->escape($args); 
    12181218 
    1219       $post_ID     = $args[0]; 
     1219      $post_ID     = (int) $args[0]; 
    12201220      $user_login  = $args[1]; 
    12211221      $user_pass   = $args[2]; 
     
    12791279        $this->escape($args); 
    12801280 
    1281         $blog_ID     = $args[0]; 
     1281        $blog_ID     = (int) $args[0]; 
    12821282        $user_login  = $args[1]; 
    12831283        $user_pass   = $args[2]; 
    1284         $num_posts   = $args[3]; 
     1284        $num_posts   = (int) $args[3]; 
    12851285 
    12861286        if (!$this->login_pass_ok($user_login, $user_pass)) { 
     
    13521352        $this->escape($args); 
    13531353 
    1354         $blog_ID     = $args[0]; 
     1354        $blog_ID     = (int) $args[0]; 
    13551355        $user_login  = $args[1]; 
    13561356        $user_pass   = $args[2]; 
     
    13871387        global $wpdb; 
    13881388 
    1389         $blog_ID     = $wpdb->escape($args[0])
     1389        $blog_ID     = (int) $args[0]
    13901390        $user_login  = $wpdb->escape($args[1]); 
    13911391        $user_pass   = $wpdb->escape($args[2]); 
     
    14481448 
    14491449        // Save the data 
    1450         $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); 
     1450        $id = (int) wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); 
    14511451        wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); 
    14521452 
     
    14641464        $this->escape($args); 
    14651465 
    1466         $blog_ID     = $args[0]; 
     1466        $blog_ID     = (int) $args[0]; 
    14671467        $user_login  = $args[1]; 
    14681468        $user_pass   = $args[2]; 
    1469         $num_posts   = $args[3]; 
     1469        $num_posts   = (int) $args[3]; 
    14701470 
    14711471        if (!$this->login_pass_ok($user_login, $user_pass)) { 
     
    15091509        $this->escape($args); 
    15101510 
    1511         $blog_ID     = $args[0]; 
     1511        $blog_ID     = (int) $args[0]; 
    15121512        $user_login  = $args[1]; 
    15131513        $user_pass   = $args[2]; 
     
    15381538        $this->escape($args); 
    15391539 
    1540         $post_ID     = $args[0]; 
     1540        $post_ID     = (int) $args[0]; 
    15411541        $user_login  = $args[1]; 
    15421542        $user_pass   = $args[2]; 
     
    15681568        $this->escape($args); 
    15691569 
    1570         $post_ID     = $args[0]; 
     1570        $post_ID     = (int) $args[0]; 
    15711571        $user_login  = $args[1]; 
    15721572        $user_pass   = $args[2]; 
     
    16511651        $this->escape($args); 
    16521652 
    1653         $post_ID     = $args[0]; 
     1653        $post_ID     = (int) $args[0]; 
    16541654        $user_login  = $args[1]; 
    16551655        $user_pass   = $args[2]; 
     
    17131713            // the path defines the post_ID (archives/p/XXXX) 
    17141714            $blah = explode('/', $match[0]); 
    1715             $post_ID = $blah[1]; 
     1715            $post_ID = (int) $blah[1]; 
    17161716            $way = 'from the path'; 
    17171717        } elseif (preg_match('#p=[0-9]{1,}#', $urltest['query'], $match)) { 
    17181718            // the querystring defines the post_ID (?p=XXXX) 
    17191719            $blah = explode('=', $match[0]); 
    1720             $post_ID = $blah[1]; 
     1720            $post_ID = (int) $blah[1]; 
    17211721            $way = 'from the querystring'; 
    17221722        } elseif (isset($urltest['fragment'])) { 
     
    17241724            if (intval($urltest['fragment'])) { 
    17251725                // ...an integer #XXXX (simpliest case) 
    1726                 $post_ID = $urltest['fragment']; 
     1726                $post_ID = (int) $urltest['fragment']; 
    17271727                $way = 'from the fragment (numeric)'; 
    17281728            } elseif (preg_match('/post-[0-9]+/',$urltest['fragment'])) { 
     
    18381838        $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type'); 
    18391839 
    1840         $comment_ID = wp_new_comment($commentdata); 
     1840        $comment_ID = (int) wp_new_comment($commentdata); 
    18411841        do_action('pingback_post', $comment_ID); 
    18421842 
     
    18561856        $url = $args; 
    18571857 
    1858   &nbs