Make WordPress Core


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/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 );
Note: See TracChangeset for help on using the changeset viewer.