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:
parent
29cc2b5b9c
commit
33d0588565
|
@ -520,8 +520,18 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||||
if ( $do_lock && $id && is_numeric($id) )
|
if ( $do_lock && $id && is_numeric($id) )
|
||||||
wp_set_post_lock( $id );
|
wp_set_post_lock( $id );
|
||||||
|
|
||||||
if ( $nonce_age == 2 )
|
if ( $nonce_age == 2 ) {
|
||||||
$supplemental['replace-autosavenonce'] = wp_create_nonce('autosave');
|
$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(
|
$x = new WP_Ajax_Response( array(
|
||||||
'what' => 'autosave',
|
'what' => 'autosave',
|
||||||
|
|
|
@ -953,7 +953,7 @@ if ( !function_exists('wp_nonce_tick') ) :
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function wp_nonce_tick() {
|
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 ));
|
return ceil(time() / ( $nonce_life / 2 ));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue