- additional changes from latest Champ commit;

This commit is contained in:
Mykyta Synelnikov
2023-07-07 00:45:12 +03:00
parent 75e3ce9391
commit fc6182c026
2 changed files with 9 additions and 4 deletions
+3 -1
View File
@@ -206,7 +206,9 @@ if ( ! class_exists( 'um\common\Secure' ) ) {
*/
public function revoke_caps( $user ) {
$user_agent = '';
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
if ( isset( $_REQUEST['nonce'], $_REQUEST['action'] ) && 'um_secure_scan_affected_users' === $_REQUEST['action'] && wp_verify_nonce( $_REQUEST['nonce'], 'um-admin-nonce' ) && current_user_can( 'manage_options' ) ) {
$user_agent = __( 'Ultimate Member Scanner', 'ultimate-member' );
} elseif ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
$user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) );
}
// Capture details.