diff --git a/all-in-one-wp-security/other-includes/wp-security-stop-users-enumeration.php b/all-in-one-wp-security/other-includes/wp-security-stop-users-enumeration.php index df711d4..fcafb7c 100644 --- a/all-in-one-wp-security/other-includes/wp-security-stop-users-enumeration.php +++ b/all-in-one-wp-security/other-includes/wp-security-stop-users-enumeration.php @@ -9,3 +9,9 @@ wp_die('Accessing author info via link is forbidden'); } } + +if(( preg_match('/users/', $_SERVER['REQUEST_URI']) !== 0 ) || ( isset($_REQUEST['rest_route']) && ( preg_match('/users/', $_REQUEST['rest_route']) !== 0 ))){ + if( ! is_user_logged_in() ) { + wp_die('Accessing author info via REST API is forbidden'); + } +}