Make WordPress Core


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

(int)er the dragon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r4953 r5087  
    116116                if ( !$category_nicename = sanitize_title($cat_name) )
    117117                        die('0');
    118                 if ( !$cat_id = category_exists( $cat_name ) )
    119                         $cat_id = wp_create_category( $cat_name );
     118                if ( !$cat_id = (int) category_exists( $cat_name ) )
     119                        $cat_id = (int) wp_create_category( $cat_name );
    120120                $cat_name = wp_specialchars(stripslashes($cat_name));
    121121                $x->add( array(
     
    157157        if ( $id < 0 ) {
    158158                $now = current_time('timestamp', 1);
    159                 if ( $pid = wp_insert_post( array(
     159                if ( $pid = (int) wp_insert_post( array(
    160160                        'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now))
    161161                ) ) )
    162                         $mid = add_meta( $pid );
     162                        $mid = (int) add_meta( $pid );
    163163                else
    164164                        die('0');
    165         } else if ( !$mid = add_meta( $id ) ) {
     165        } else if ( !$mid = (int) add_meta( $id ) ) {
    166166                die('0');
    167167        }
     
    205205                die('-1');
    206206        require_once(ABSPATH . WPINC . '/registration.php');
    207         if ( !$user_id = add_user() )
     207        if ( !$user_id = (int) add_user() )
    208208                die('0');
    209209        elseif ( is_wp_error( $user_id ) ) {
     
    231231        if($_POST['post_ID'] < 0) {
    232232                $_POST['temp_ID'] = $_POST['post_ID'];
    233                 $id = wp_write_post();
     233                $id = (int) wp_write_post();
    234234                if(is_wp_error($id))
    235235                        die($id->get_error_message());
Note: See TracChangeset for help on using the changeset viewer.