Skip to content

Commit

Permalink
Add missing multiplicator for nonce life
Browse files Browse the repository at this point in the history
Fixes #180
  • Loading branch information
ocean90 committed Dec 23, 2024
1 parent 42acc61 commit fd92e50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public-post-preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,8 @@ private static function maybe_redirect_to_published_post( $post_id ) {
* @return int The time-dependent variable.
*/
private static function nonce_tick() {
$nonce_life = apply_filters( 'ppp_nonce_life', get_option( 'public_post_preview_expiration_time' ) ?: 48 );
$expiration = get_option( 'public_post_preview_expiration_time' ) ?: 48;
$nonce_life = apply_filters( 'ppp_nonce_life', $expiration * HOUR_IN_SECONDS );

return ceil( time() / ( $nonce_life / 2 ) );
}
Expand Down

0 comments on commit fd92e50

Please sign in to comment.