Changeset 933

Show
Ignore:
Timestamp:
03/23/07 17:46:02 (2 years ago)
Author:
donncha
Message:

Ryan casts an int and catches a fish, someone buy him a pint! merge to 5092

Files:

Legend:

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

    r909 r933  
    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; 
     
    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

    r904 r933  
    232232                $_POST['temp_ID'] = $_POST['post_ID']; 
    233233                $id = wp_write_post(); 
    234                 if(is_wp_error($id)
     234                if( is_wp_error($id)
    235235                        die($id->get_error_message()); 
    236236                else 
  • trunk/wp-admin/admin-db.php

    r932 r933  
    251251                return 0; 
    252252 
    253         return $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'"); 
     253        return (int) $wpdb->get_var("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename = '$category_nicename'"); 
    254254} 
    255255 
     
    303303        if ( !empty($link_id) ) 
    304304                $update = true; 
     305 
     306        $link_id = (int) $link_id; 
    305307 
    306308        if( trim( $link_name ) == '' ) 
     
    365367        } else { 
    366368                $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')"); 
    367                 $link_id = $wpdb->insert_id; 
     369                $link_id = (int) $wpdb->insert_id; 
    368370        } 
    369371 
     
    448450                SELECT category_id 
    449451                FROM $wpdb->link2cat 
    450                 WHERE link_id = $link_ID"); 
     452                WHERE link_id = '$link_ID'"); 
    451453 
    452454        if (!$old_categories) { 
     
    461463        if ($delete_cats) { 
    462464                foreach ($delete_cats as $del) { 
     465                        $del = (int) $del; 
    463466                        $wpdb->query(" 
    464467                                DELETE FROM $wpdb->link2cat 
    465                                 WHERE category_id = $del 
    466                                         AND link_id = $link_ID 
     468                                WHERE category_id = '$del' 
     469                                        AND link_id = '$link_ID' 
    467470                                "); 
    468471                } 
  • trunk/wp-admin/admin-functions.php

    r928 r933  
    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 ); 
     
    804804        if ( current_user_can( 'manage_categories' ) ) { 
    805805                $edit = "<a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>".__( 'Edit' )."</a></td>"; 
    806                 $default_cat_id = get_option( 'default_category' ); 
    807                 $default_link_cat_id = get_option( 'default_link_category' ); 
     806                $default_cat_id = (int) get_option( 'default_category' ); 
     807                $default_link_cat_id = (int) get_option( 'default_link_category' ); 
    808808 
    809809                if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) ) 
     
    844844                $post->post_title = wp_specialchars( $post->post_title ); 
    845845                $pad = str_repeat( '&#8212; ', $level ); 
    846                 $id = $post->ID; 
     846                $id = (int) $post->ID; 
    847847                $class = ('alternate' == $class ) ? '' : 'alternate'; 
    848848?> 
  • trunk/wp-admin/edit-comments.php

    r920 r933  
    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

    r920 r933  
    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

    r810 r933  
    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

    r819 r933  
    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

    r819 r933  
    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

    r819 r933  
    155155                } 
    156156                $this->file = $file['file']; 
    157                 $this->id = $file['id']; 
     157                $this->id = (int) $file['id']; 
    158158 
    159159                $this->get_entries(); 
     
    279279                                } 
    280280 
    281                                 $comment_post_ID = $post_id; 
     281                                $comment_post_ID = (int) $post_id; 
    282282                                $comment_approved = 1; 
    283283 
  • trunk/wp-admin/import/wordpress.php

    r881 r933  
    158158                } 
    159159                $this->file = $file['file']; 
    160                 $this->id = $file['id']; 
     160                $this->id = (int) $file['id']; 
    161161 
    162162                $this->get_entries(); 
     
    185185                                $category_parent = '0'; 
    186186                        else 
    187                                 $category_parent = (int) category_exists($parent); 
     187                                $category_parent = category_exists($parent); 
    188188 
    189189                        $catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name'); 
  • trunk/wp-admin/user-edit.php

    r920 r933  
    1414// Only allow site admins to edit every user. 
    1515if ( !is_site_admin() && ($user_id != $current_user->ID) ) 
    16         $errors = new WP_Error('head', __('You do not have permission to edit this user.')); 
     16        wp_die('You do not have permission to edit this user.'); 
    1717 
    1818$user_id = (int) $user_id; 
  • trunk/wp-includes/author-template.php

    r828 r933  
    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

    r920 r933  
    166166                return ''; 
    167167 
    168         $cat_id = $cats[0]; // Take the first cat. 
     168        $cat_id = (int) $cats[0]; // Take the first cat. 
    169169 
    170170        $cat = get_category($cat_id); 
  • trunk/wp-includes/category-template.php

    r915 r933  
    6666global $post, $category_cache, $blog_id; 
    6767 
     68        $id = (int) $id; 
    6869        if ( !$id ) 
    69                 $id = $post->ID; 
     70                $id = (int) $post->ID; 
    7071 
    7172        if ( !isset($category_cache[$blog_id][$id]) ) 
  • trunk/wp-includes/comment-template.php

    r920 r933  
    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

    r920 r933  
    346346        "); 
    347347 
    348         $id = $wpdb->insert_id; 
     348        $id = (int) $wpdb->insert_id; 
    349349 
    350350        if ( $comment_approved == 1) 
  • trunk/wp-includes/feed.php

    r915 r933  
    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/formatting.php

    r928 r933  
    10731073        $url = str_replace($strip, '', $url); 
    10741074        $url = str_replace(';//', '://', $url); 
     1075        // Append http unless a relative link starting with / or a php file. 
     1076        if ( strpos($url, '://') === false && 
     1077                substr( $url, 0, 1 ) != '/' && !preg_match('/^[a-z0-9]+.php/i', $url) ) 
     1078                $url = 'http://' . $url; 
     1079         
    10751080        $url = (strpos($url, '://') === false && substr( $url, 0, 1 ) != '/' ) ? 'http://'.$url : $url; 
    10761081        $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url); 
  • trunk/wp-includes/functions.php

    r920 r933  
    664664        $count = count( $post_id_array); 
    665665        for ( $i = 0; $i < $count; $i++ ) { 
    666                 $post_id = $post_id_array[ $i ]; 
     666                $post_id = (int) $post_id_array[ $i ]; 
    667667                if ( isset( $category_cache[$blog_id][$post_id] ) ) { 
    668668                        unset( $post_id_array[ $i ] ); 
     
    718718        $count = count( $post_id_array); 
    719719        for ( $i = 0; $i < $count; $i++ ) { 
    720                 $post_id = $post_id_array[ $i ]; 
     720                $post_id = (int) $post_id_array[ $i ]; 
    721721                if ( isset( $post_meta_cache[$blog_id][$post_id] ) ) { // If the meta is already cached 
    722722                        unset( $post_id_array[ $i ] ); 
  • trunk/wp-includes/link-template.php

    r931 r933  
    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

    r909 r933  
    533533function wp_verify_nonce($nonce, $action = -1) { 
    534534        $user = wp_get_current_user(); 
    535         $uid = $user->id; 
     535        $uid = (int) $user->id; 
    536536 
    537537        $i = ceil(time() / 43200); 
     
    547547function wp_create_nonce($action = -1) { 
    548548        $user = wp_get_current_user(); 
    549         $uid = $user->id; 
     549        $uid = (int) $user->id; 
    550550 
    551551        $i = ceil(time() / 43200); 
  • trunk/wp-includes/post.php

    r916 r933  
    376376 
    377377        if ( !$post_id ) 
    378                 $post_id = $id; 
     378                $post_id = (int) $id; 
    379379 
    380380        $post_id = (int) $post_id; 
     
    450450 
    451451function wp_get_post_categories($post_id = 0) { 
     452        $post_id = (int) $post_id; 
     453 
    452454        $cats = &get_the_category($post_id); 
    453455        $cat_ids = array(); 
     
    461463 
    462464        // Set the limit clause, if we got a limit 
     465        $num = (int) $num; 
    463466        if ($num) { 
    464467                $limit = "LIMIT $num"; 
     
    473476function wp_get_single_post($postid = 0, $mode = OBJECT) { 
    474477        global $wpdb; 
     478 
     479        $postid = (int) $postid; 
    475480 
    476481        $post = get_post($postid, $mode); 
     
    537542        // Get the post ID. 
    538543        if ( $update ) 
    539                 $post_ID = $ID; 
     544                $post_ID = (int) $ID; 
    540545 
    541546        // Create a valid post name.  Drafts are allowed to have an empty 
     
    641646                        VALUES 
    642647                        ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$post_type', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type')"); 
    643                         $post_ID = $wpdb->insert_id; 
     648                        $post_ID = (int) $wpdb->insert_id; 
    644649        } 
    645650 
     
    769774function wp_set_post_categories($post_ID = 0, $post_categories = array()) { 
    770775        global $wpdb; 
     776 
     777        $post_ID = (int) $post_ID; 
    771778        // If $post_categories isn't already an array, make it one: 
    772779        if (!is_array($post_categories) || 0 == count($post_categories) || empty($post_categories)) 
     
    779786                SELECT category_id 
    780787                FROM $wpdb->post2cat 
    781                 WHERE post_id = $post_ID"); 
     788                WHERE post_id = '$post_ID'"); 
    782789 
    783790        if (!$old_categories) { 
     
    794801                        $wpdb->query(" 
    795802                                DELETE FROM $wpdb->post2cat 
    796                                 WHERE category_id = $del 
    797                                         AND post_id = $post_ID 
     803                                WHERE category_id = '$del' 
     804                                        AND post_id = '$post_ID' 
    798805                                "); 
    799806                } 
     
    12521259        if ( !empty($ID) ) { 
    12531260                $update = true; 
    1254                 $post_ID = $ID; 
     1261                $post_ID = (int) $ID; 
    12551262        } 
    12561263 
     
    13471354                        VALUES 
    13481355                        ('$post_author', '$post_date', '$post_date_gmt', '$post_content', '$post_content_filtered', '$post_title', '$post_excerpt', '$post_status', '$post_type', '$comment_status', '$ping_status', '$post_password', '$post_name', '$to_ping', '$pinged', '$post_date', '$post_date_gmt', '$post_parent', '$menu_order', '$post_mime_type', '$guid')"); 
    1349                         $post_ID = $wpdb->insert_id; 
     1356                        $post_ID = (int) $wpdb->insert_id; 
    13501357        } 
    13511358 
     
    15021509                if ( !$post =& get_post( $mime ) ) 
    15031510                        return false; 
    1504                 $post_id = $post->ID; 
     1511                $post_id = (int) $post->ID; 
    15051512                $mime = $post->post_mime_type; 
    15061513        } 
  • trunk/wp-includes/query.php

    r909 r933  
    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

    r828 r933  
    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

    r915 r933  
    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

    r920 r933  
    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-trackback.php

    r868 r933  
    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

    r931 r933  
    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]; 
    364                 $page_id        = $this->escape($args[1]); 
     363                $blog_id        = (int) $args[0]; 
     364                $page_id        = $this->escape((int) $args[1]); 
    365365                $username       = $this->escape($args[2]); 
    366366                $password       = $this->escape($args[3]); 
     
    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]; 
     
    530530                $this->escape($args); 
    531531 
    532                 $blog_id                                = $args[0]; 
     532                $blog_id                                = (int) $args[0]; 
    533533                $username                               = $args[1]; 
    534534                $password                               = $args[2]; 
     
    631631                $this->escape($args); 
    632632 
    633                 $post_ID    = $args[1]; 
     633                $post_ID    = (int) $args[1]; 
    634634                $user_login = $args[2]; 
    635635                $user_pass  = $args[3]; 
     
    666666                $this->escape($args); 
    667667 
    668                 $blog_ID    = $args[1]; /* though we don't use it yet */ 
     668                $blog_ID    = (int) $args[1]; /* though we don't use it yet */ 
    669669                $user_login = $args[2]; 
    670670                $user_pass  = $args[3]; 
     
    714714                $this->escape($args); 
    715715 
    716           $blog_ID    = $args[1]; 
     716          $blog_ID    = (int) $args[1]; 
    717717          $user_login = $args[2]; 
    718718          $user_pass  = $args[3]; 
     
    748748                $this->escape($args); 
    749749 
    750           $blog_ID    = $args[1]; 
     750          $blog_ID    = (int) $args[1]; 
    751751          $user_login = $args[2]; 
    752752          $user_pass  = $args[3]; 
     
    785785                $this->escape($args); 
    786786 
    787           $blog_ID    = $args[1]; /* though we don't use it yet */ 
     787          $blog_ID    = (int) $args[1]; /* though we don't use it yet */ 
    788788          $user_login = $args[2]; 
    789789          $user_pass  = $args[3]; 
     
    833833                $this->escape($args); 
    834834 
    835           $post_ID     = $args[1]; 
     835          $post_ID     = (int) $args[1]; 
    836836          $user_login  = $args[2]; 
    837837          $user_pass   = $args[3]; 
     
    884884                $this->escape($args); 
    885885 
    886           $post_ID     = $args[1]; 
     886          $post_ID     = (int) $args[1]; 
    887887          $user_login  = $args[2]; 
    888888          $user_pass   = $args[3]; 
     
    925925                $this->escape($args); 
    926926 
    927           $blog_ID     = $args[0]; // we will support this in the near future 
     927          $blog_ID     = (int) $args[0]; // we will support this in the near future 
    928928          $user_login  = $args[1]; 
    929929          $user_pass   = $args[2]; 
     
    10751075                $this->escape($args); 
    10761076 
    1077           $post_ID     = $args[0]; 
     1077          $post_ID     = (int) $args[0]; 
    10781078          $user_login  = $args[1]; 
    10791079          $user_pass   = $args[2]; 
     
    12271227                $this->escape($args); 
    12281228 
    1229           $post_ID     = $args[0]; 
     1229          $post_ID     = (int) $args[0]; 
    12301230          $user_login  = $args[1]; 
    12311231          $user_pass   = $args[2]; 
     
    12891289                $this->escape($args); 
    12901290 
    1291                 $blog_ID     = $args[0]; 
     1291                $blog_ID     = (int) $args[0]; 
    12921292                $user_login  = $args[1]; 
    12931293                $user_pass   = $args[2]; 
    1294                 $num_posts   = $args[3]; 
     1294                $num_posts   = (int) $args[3]; 
    12951295 
    12961296                if (!$this->login_pass_ok($user_login, $user_pass)) { 
     
    13621362                $this->escape($args); 
    13631363 
    1364                 $blog_ID     = $args[0]; 
     1364                $blog_ID     = (int) $args[0]; 
    13651365                $user_login  = $args[1]; 
    13661366                $user_pass   = $args[2]; 
     
    13971397                global $wpdb; 
    13981398 
    1399                 $blog_ID     = $wpdb->escape($args[0])
     1399                $blog_ID     = (int) $args[0]
    14001400                $user_login  = $wpdb->escape($args[1]); 
    14011401                $user_pass   = $wpdb->escape($args[2]); 
     
    14741474          &nb