Skip to content

Commit 26505a3

Browse files
author
xecdev
committed
Guard against missing/empty paybutton_public_key before save
1 parent be106ef commit 26505a3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

includes/class-paybutton-admin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ public function process_settings_forms() {
116116
) &&
117117
current_user_can( 'manage_options' )
118118
) {
119+
if ( empty( $_POST['paybutton_public_key'] ) ) {
120+
wp_safe_redirect(
121+
admin_url( 'admin.php?page=paybutton-settings&settings-updated=false' )
122+
);
123+
exit;
124+
}
119125
$public_key = sanitize_text_field(
120126
wp_unslash( $_POST['paybutton_public_key'] )
121127
);

0 commit comments

Comments
 (0)