Make WordPress Core

Changeset 5087 for trunk/xmlrpc.php


Ignore:
Timestamp:
03/23/2007 12:59:21 AM (18 years ago)
Author:
matt
Message:

(int)er the dragon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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         $post_ID = url_to_postid($url);
     1858        $post_ID = (int) url_to_postid($url);
    18591859        if (!$post_ID) {
    18601860            // We aren't sure that the resource is available and/or pingback enabled
Note: See TracChangeset for help on using the changeset viewer.