From 7ac67243e8eed201ec29b1d310bf2b11e619ad56 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 11 Aug 2006 18:50:28 +0000 Subject: [PATCH] autosave fix ups git-svn-id: http://svn.automattic.com/wordpress/trunk@4086 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 13 +++++++++++++ wp-admin/edit-form-advanced.php | 2 +- wp-admin/edit-page-form.php | 2 +- wp-admin/post.php | 2 +- wp-includes/js/autosave.js.php | 19 +++++++++++++++++++ wp-includes/script-loader.php | 2 +- 6 files changed, 36 insertions(+), 4 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index dcd69c49c2..8e8be54537 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -246,6 +246,19 @@ case 'autosave' : } die('0'); break; +case 'autosave-generate-nonces' : + $ID = (int) $_POST['post_ID']; + if($_POST['post_type'] == 'post') { + if(current_user_can('edit_post', $ID)) + die(wp_create_nonce('update-post_' . $ID)); + } + if($_POST['post_type'] == 'page') { + if(current_user_can('edit_page', $ID)) { + die(wp_create_nonce('update-page_' . $ID)); + } + } + die($_POST['post_type']); +break; default : do_action( 'wp_ajax_' . $_POST['action'] ); die('0'); diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 21c60f584a..29ac70b7ac 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -53,7 +53,7 @@ if (empty($post->post_status)) $post->post_status = 'draft'; - + $_GET['message']) : ?> diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index a27fc4e99e..3999276921 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -34,7 +34,7 @@ if (isset($mode) && 'bookmarklet' == $mode) { - +