Skip to content

Commit

Permalink
Merge pull request #87 from davidegiunchidiennea/master
Browse files Browse the repository at this point in the history
stop-users-enumeration: added enumeration block via REST API (wp >= 4.7)
  • Loading branch information
Arsenal21 authored Aug 30, 2017
2 parents 98ae25a + 0f9ed5c commit 9c68ce1
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

0 comments on commit 9c68ce1

Please sign in to comment.