Plugin Directory

Changeset 2002769


Ignore:
Timestamp:
12/28/2018 09:31:49 AM (7 years ago)
Author:
thapa.laxman
Message:

fixed author enumeration via curl & grep

Location:
disable-feeds-and-hide-usernames/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • disable-feeds-and-hide-usernames/trunk/README.txt

    r1598489 r2002769  
    44Tags: disable feeds, hide username, remove rss
    55Requires at least: 3.0.1
    6 Tested up to: 4.7.2
     6Tested up to: 5.0.2
    77Stable tag: 1.1
    88License: GPLv2 or later
  • disable-feeds-and-hide-usernames/trunk/disable-feeds-hide-usernames.php

    r2002767 r2002769  
    44Description: This tiny and lightweight plugin removes all the rss feeds  and hides usernames making it harder for attacker to guess the username.
    55Author: Laxman Thapa
    6 Version: 1.0
     6Version: 1.1
    77*/
    88
     
    1818
    1919if (!is_admin()) {
    20     if (preg_match('/author=([0-9]*)/i', $_SERVER['QUERY_STRING'])) die();
     20    if (preg_match('/author=([0-9]*)/i', $_SERVER['QUERY_STRING'])) {
     21        header('Location: '.home_url().'', false, 301);
     22        die();
     23    }
    2124    add_filter('redirect_canonical', function($redirect, $request){
    22         if (preg_match('/\?author=([0-9]*)(\/*)/i', $request)) die();
     25        if (preg_match('/\?author=([0-9]*)(\/*)/i', $request)) {
     26            header('Location: '.home_url().'', false, 301);
     27            die();
     28        }
    2329        else return $redirect;
    2430    }, 10, 2);
Note: See TracChangeset for help on using the changeset viewer.