Make WordPress Core

Changeset 5083


Ignore:
Timestamp:
03/22/2007 09:40:54 PM (19 years ago)
Author:
ryan
Message:

Cast to int

Location:
branches/2.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/wp-includes/category-template.php

    r4774 r5083  
    6363global $post, $category_cache, $blog_id;
    6464
     65    $id = (int) $id;
    6566    if ( !$id )
    6667        $id = $post->ID;
  • branches/2.1/wp-includes/post.php

    r5030 r5083  
    448448
    449449function wp_get_post_categories($post_id = 0) {
     450    $post_id = (int) $post_id;
     451
    450452    $cats = &get_the_category($post_id);
    451453    $cat_ids = array();
     
    459461
    460462    // Set the limit clause, if we got a limit
     463    $num = (int) $num;
    461464    if ($num) {
    462465        $limit = "LIMIT $num";
     
    471474function wp_get_single_post($postid = 0, $mode = OBJECT) {
    472475    global $wpdb;
     476
     477    $postid = (int) $postid;
    473478
    474479    $post = get_post($postid, $mode);
  • branches/2.1/xmlrpc.php

    r5075 r5083  
    412412        $this->escape($args);
    413413
    414       $post_ID     = $args[1];
     414      $post_ID     = (int) $args[1];
    415415      $user_login  = $args[2];
    416416      $user_pass   = $args[3];
     
    601601        $this->escape($args);
    602602
    603       $post_ID     = $args[0];
     603      $post_ID     = (int) $args[0];
    604604      $user_login  = $args[1];
    605605      $user_pass   = $args[2];
Note: See TracChangeset for help on using the changeset viewer.