Add nonce protection for setting/removing featured post image. fixes #13438

git-svn-id: http://svn.automattic.com/wordpress/trunk@14730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith
2010-05-18 22:08:49 +00:00
parent af59c18f45
commit 20cb3ed21b
8 changed files with 18 additions and 14 deletions

View File

@@ -218,9 +218,9 @@ WPSetThumbnailID = function(id){
}
};
WPRemoveThumbnail = function(){
WPRemoveThumbnail = function(nonce){
$.post(ajaxurl, {
action:"set-post-thumbnail", post_id: $('#post_ID').val(), thumbnail_id: -1, cookie: encodeURIComponent(document.cookie)
action:"set-post-thumbnail", post_id: $('#post_ID').val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie)
}, function(str){
if ( str == '0' ) {
alert( setPostThumbnailL10n.error );