More nonce renewals from andy. fixes #6266

git-svn-id: https://develop.svn.wordpress.org/trunk@7376 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-03-18 04:59:54 +00:00
parent 29cc2b5b9c
commit 33d0588565
2 changed files with 12 additions and 2 deletions

View File

@ -520,8 +520,18 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
if ( $do_lock && $id && is_numeric($id) )
wp_set_post_lock( $id );
if ( $nonce_age == 2 )
if ( $nonce_age == 2 ) {
$supplemental['replace-autosavenonce'] = wp_create_nonce('autosave');
$supplemental['replace-getpermalinknonce'] = wp_create_nonce('getpermalink');
$supplemental['replace-samplepermalinknonce'] = wp_create_nonce('samplepermalink');
$supplemental['replace-closedpostboxesnonce'] = wp_create_nonce('closedpostboxes');
if ( $id ) {
if ( $_POST['post_type'] == 'post' )
$supplemental['replace-_wpnonce'] = wp_create_nonce('update-post_' . $id);
elseif ( $_POST['post_type'] == 'page' )
$supplemental['replace-_wpnonce'] = wp_create_nonce('update-page_' . $id);
}
}
$x = new WP_Ajax_Response( array(
'what' => 'autosave',

View File

@ -953,7 +953,7 @@ if ( !function_exists('wp_nonce_tick') ) :
* @return int
*/
function wp_nonce_tick() {
$nonce_life = apply_filters('nonce_life', 86400) / 2;
$nonce_life = apply_filters('nonce_life', 86400);
return ceil(time() / ( $nonce_life / 2 ));
}