Changeset 2002769
- Timestamp:
- 12/28/2018 09:31:49 AM (7 years ago)
- Location:
- disable-feeds-and-hide-usernames/trunk
- Files:
-
- 2 edited
-
README.txt (modified) (1 diff)
-
disable-feeds-hide-usernames.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
disable-feeds-and-hide-usernames/trunk/README.txt
r1598489 r2002769 4 4 Tags: disable feeds, hide username, remove rss 5 5 Requires at least: 3.0.1 6 Tested up to: 4.7.26 Tested up to: 5.0.2 7 7 Stable tag: 1.1 8 8 License: GPLv2 or later -
disable-feeds-and-hide-usernames/trunk/disable-feeds-hide-usernames.php
r2002767 r2002769 4 4 Description: This tiny and lightweight plugin removes all the rss feeds and hides usernames making it harder for attacker to guess the username. 5 5 Author: Laxman Thapa 6 Version: 1. 06 Version: 1.1 7 7 */ 8 8 … … 18 18 19 19 if (!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 } 21 24 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 } 23 29 else return $redirect; 24 30 }, 10, 2);
Note: See TracChangeset
for help on using the changeset viewer.