Make WordPress Core

Changeset 10235


Ignore:
Timestamp:
12/20/2008 01:00:26 AM (16 years ago)
Author:
azaozz
Message:

Set parseInt() to use base 10 instead of detecting it, props projct, fixes #8659

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/autosave.js

    r10222 r10235  
    3434        // if no errors: add slug UI
    3535        if ( !res.errors ) {
    36             var postID = parseInt( res.responses[0].id );
     36            var postID = parseInt( res.responses[0].id, 10 );
    3737            if ( !isNaN(postID) && postID > 0 ) {
    3838                autosave_update_slug(postID);
     
    5757    if ( res && res.responses.length && !res.errors ) {
    5858        var tempID = jQuery('#post_ID').val();
    59         var postID = parseInt( res.responses[0].id );
     59        var postID = parseInt( res.responses[0].id, 10 );
    6060        autosave_update_post_ID( postID ); // disabled form buttons are re-enabled here
    6161        if ( tempID < 0 && postID > 0 ) // update media buttons
     
    7474function autosave_update_post_ID( postID ) {
    7575    if ( !isNaN(postID) && postID > 0 ) {
    76         if ( postID == parseInt(jQuery('#post_ID').val()) ) { return; } // no need to do this more than once
     76        if ( postID == parseInt(jQuery('#post_ID').val(), 10) ) { return; } // no need to do this more than once
    7777        jQuery('#post_ID').attr({name: "post_ID"});
    7878        jQuery('#post_ID').val(postID);
     
    191191    }
    192192
    193     if(parseInt(post_data["post_ID"]) < 1) {
     193    if ( parseInt(post_data["post_ID"], 10) < 1 ) {
    194194        post_data["temp_ID"] = post_data["post_ID"];
    195195        var successCallback = autosave_saved_new; // new post
Note: See TracChangeset for help on using the changeset viewer.