From 9f66fcd434326f1ce9b59de7c99093636f69ebab Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 20 Dec 2008 01:00:26 +0000 Subject: [PATCH] Set parseInt() to use base 10 instead of detecting it, props projct, fixes #8659 git-svn-id: https://develop.svn.wordpress.org/trunk@10235 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/autosave.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js index 75b4e88c08..96f3e91443 100644 --- a/wp-includes/js/autosave.js +++ b/wp-includes/js/autosave.js @@ -33,7 +33,7 @@ function autosave_parse_response(response) { // if no errors: add slug UI if ( !res.errors ) { - var postID = parseInt( res.responses[0].id ); + var postID = parseInt( res.responses[0].id, 10 ); if ( !isNaN(postID) && postID > 0 ) { autosave_update_slug(postID); } @@ -56,7 +56,7 @@ function autosave_saved_new(response) { // if no errors: update post_ID from the temporary value, grab new save-nonce for that new ID if ( res && res.responses.length && !res.errors ) { var tempID = jQuery('#post_ID').val(); - var postID = parseInt( res.responses[0].id ); + var postID = parseInt( res.responses[0].id, 10 ); autosave_update_post_ID( postID ); // disabled form buttons are re-enabled here if ( tempID < 0 && postID > 0 ) // update media buttons jQuery('#media-buttons a').each(function(){ @@ -73,7 +73,7 @@ function autosave_saved_new(response) { function autosave_update_post_ID( postID ) { if ( !isNaN(postID) && postID > 0 ) { - if ( postID == parseInt(jQuery('#post_ID').val()) ) { return; } // no need to do this more than once + if ( postID == parseInt(jQuery('#post_ID').val(), 10) ) { return; } // no need to do this more than once jQuery('#post_ID').attr({name: "post_ID"}); jQuery('#post_ID').val(postID); // We need new nonces @@ -190,7 +190,7 @@ var autosave = function() { doAutoSave = false; } - if(parseInt(post_data["post_ID"]) < 1) { + if ( parseInt(post_data["post_ID"], 10) < 1 ) { post_data["temp_ID"] = post_data["post_ID"]; var successCallback = autosave_saved_new; // new post } else {