Advertisement
gilzow

Block user enumeration

Sep 30th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. function scanForEnumerationAttempt($strRedirectionURL, $strRequestedURL) {
  2.     if (1 === preg_match('/\?author=([\d]*)/', $strRequestedURL)) {
  3.         $strRedirectionURL = false;
  4.     }
  5.    
  6.    return $strRedirectionURL;
  7. }
  8.  
  9. add_filter('redirect_canonical','scanForEnumerationAttempt', 10,2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement