diff --git a/dt-core/admin/menu/tabs/tab-custom-roles.php b/dt-core/admin/menu/tabs/tab-custom-roles.php index da9d120a97..41fbecd6d4 100644 --- a/dt-core/admin/menu/tabs/tab-custom-roles.php +++ b/dt-core/admin/menu/tabs/tab-custom-roles.php @@ -152,7 +152,14 @@ private function delete_action() { return; } - if ( !isset( $_GET['confirm'] ) ) { + if ( !isset( $_POST['role_delete_nonce'] ) ) { + $this->view_delete(); + return; + } + + $slug = sanitize_text_field( wp_unslash( $_GET['role'] ) ); + if ( !wp_verify_nonce( sanitize_key( $_POST['role_delete_nonce'] ), 'role_delete_' . $slug ) ) { + $this->show_error( new WP_Error( 401, __( 'Unauthorized', 'disciple_tools' ) ) ); $this->view_delete(); return; } @@ -841,12 +848,17 @@ class="button button-large" > - - - +