Skip to content

Commit

Permalink
merge conflict resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
Jedi Knight committed May 31, 2016
1 parent c25aaa2 commit ad77e4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,44 +1,11 @@
<?php

/*
Merged by Davide Giunchi, from plugin "Stop User Enumeration" url "http://locally.uk/wordpress-plugins/stop-user-enumeration/" by "Locally Digital Ltd"
* Merged by Davide Giunchi, from plugin "Stop User Enumeration" url "http://locally.uk/wordpress-plugins/stop-user-enumeration/" by "Locally Digital Ltd"
*/

/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

if (!is_admin()) {
if (preg_match('/(wp-comments-post)/', $_SERVER['REQUEST_URI']) === 0) {
if (!empty($_POST['author'])) {
wp_die('Accessing author info via link is forbidden');
}
}

if (preg_match('/author=([0-9]*)/', $_SERVER['QUERY_STRING']) === 1)
wp_die('Accessing author info via link is forbidden');

add_filter('redirect_canonical', 'll_detect_enumeration', 10, 2);
}

add_filter('redirect_canonical', 'll_detect_enumeration', 10, 2);

function ll_detect_enumeration($redirect_url, $requested_url) {
if (preg_match('/\?author(%00[0%]*)?=([0-9]*)(\/*)/', $requested_url) === 1 | isset($_POST['author'])) {
if (!is_admin() && isset($_SERVER['REQUEST_URI'])) {
if (preg_match('/(wp-comments-post)/', $_SERVER['REQUEST_URI']) === 0 && !empty($_REQUEST['author'])) {
wp_die('Accessing author info via link is forbidden');
} else {
return $redirect_url;
}
}
6 changes: 6 additions & 0 deletions all-in-one-wp-security/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ None

== Changelog ==

= TODO - 4.1.1 =
- Fix (minor): No need to use strcmp to compare integer values.
- Minor code cleanup (thanks to @chesio).
- Updated and simplified wp-security-stop-users-enumeration.php for bug (thanks to @davidegiunchidiennea)


= 4.1.0 =
- Fixed bug in Maintenance menu page when trying to attach a media file to the message text box.
- Added a new filter (called "aiowps_ip_blocked_error_msg") which allows the modification of the error message displayed on the login page when an IP address has been blocked by the login lockdown feature.
Expand Down

0 comments on commit ad77e4a

Please sign in to comment.