Make WordPress Core

Changeset 5084


Ignore:
Timestamp:
03/22/2007 11:02:20 PM (17 years ago)
Author:
ryan
Message:

Cast to int.

Location:
branches/2.0
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-includes/functions-post.php

    r5031 r5084  
    407407
    408408    // Set the limit clause, if we got a limit
     409    $num = (int) $num;
    409410    if ($num) {
    410411        $limit = "LIMIT $num";
     
    477478function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array()) {
    478479    global $wpdb;
     480   
     481    $post_ID = (int) $post_ID;
     482
    479483    // If $post_categories isn't already an array, make it one:
    480484    if (!is_array($post_categories) || 0 == count($post_categories))
     
    487491        SELECT category_id
    488492        FROM $wpdb->post2cat
    489         WHERE post_id = $post_ID");
     493        WHERE post_id = '$post_ID'");
    490494   
    491495    if (!$old_categories) {
     
    502506            $wpdb->query("
    503507                DELETE FROM $wpdb->post2cat
    504                 WHERE category_id = $del
    505                     AND post_id = $post_ID
     508                WHERE category_id = '$del'
     509                    AND post_id = '$post_ID'
    506510                ");
    507511        }
  • branches/2.0/wp-includes/template-functions-category.php

    r4656 r5084  
    44global $post, $category_cache;
    55
     6    $id = (int) $id;
    67    if ( !$id )
    78        $id = $post->ID;
  • branches/2.0/xmlrpc.php

    r5076 r5084  
    410410        $this->escape($args);
    411411
    412       $post_ID     = $args[1];
     412      $post_ID     = (int) $args[1];
    413413      $user_login  = $args[2];
    414414      $user_pass   = $args[3];
     
    583583        $this->escape($args);
    584584
    585       $post_ID     = $args[0];
     585      $post_ID     = (int) $args[0];
    586586      $user_login  = $args[1];
    587587      $user_pass   = $args[2];
Note: See TracChangeset for help on using the changeset viewer.