From 1baa407995301dce63de3cf89ebd87838587efe6 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Sat, 5 Mar 2016 21:28:43 +0800 Subject: [PATCH] Fix security check in registration form --- core/um-actions-register.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/um-actions-register.php b/core/um-actions-register.php index 3bbb355d..ccbefbd5 100644 --- a/core/um-actions-register.php +++ b/core/um-actions-register.php @@ -253,9 +253,11 @@ if ( isset( $args['custom_fields']['role_select'] ) || isset( $args['custom_fields']['role_radio'] ) ) return; - if (isset($args['role']) && !empty($args['role'])) { + $use_global_settings = get_post_meta( $args['form_id'], '_um_register_use_globals', true); + + if (isset($args['role']) && !empty($args['role']) && $use_global_settings == 0 ) { $role = $args['role']; - } else { + } else if( $use_global_settings == 1 ) { $role = um_get_option('default_role'); }