Skip to content

Commit

Permalink
Fix nonce security issue
Browse files Browse the repository at this point in the history
  • Loading branch information
asaquzzaman committed Aug 25, 2020
1 parent 3e90818 commit 1c173bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/Upgrades/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ public function show_update_notice() {
*/
public function do_updates() {

if ( isset( $_POST['pm_nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['pm_nonce'] ) ), '_nonce' ) ) {
if ( empty( $_POST['pm_nonce'] ) ) {
return;
}

if ( ! isset( $_POST['pm_update'] ) ) {
if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['pm_nonce'] ) ), '_nonce' ) ) {
return;
}

Expand Down

0 comments on commit 1c173bd

Please sign in to comment.