Bad Behavior - Version 2.1.6

Version Description

Download this release

Release Info

Developer error
Plugin Icon wp plugin Bad Behavior
Version 2.1.6
Comparing to
See all releases

Code changes from version 2.1.5 to 2.1.6

bad-behavior-wordpress.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Bad Behavior
4
- Version: 2.1.5
5
  Description: Deny automated spambots access to your PHP-based Web site.
6
  Plugin URI: http://www.bad-behavior.ioerror.us/
7
  Author: Michael Hampton
1
  <?php
2
  /*
3
  Plugin Name: Bad Behavior
4
+ Version: 2.1.6
5
  Description: Deny automated spambots access to your PHP-based Web site.
6
  Plugin URI: http://www.bad-behavior.ioerror.us/
7
  Author: Michael Hampton
bad-behavior/cloudflare.inc.php CHANGED
@@ -7,7 +7,7 @@ require_once(BB2_CORE . "/roundtripdns.inc.php");
7
  function bb2_cloudflare(&$package)
8
  {
9
  if (bb2_roundtripdns($package['ip'], "cloudflare.com")) {
10
- $package['ip'] = $package['headers_mixed']['Cf-Connecting-Ip'];
11
  } else {
12
  return '70e45496';
13
  }
7
  function bb2_cloudflare(&$package)
8
  {
9
  if (bb2_roundtripdns($package['ip'], "cloudflare.com")) {
10
+ $package['ip'] = preg_replace("/^::ffff:/", "", $package['headers_mixed']['Cf-Connecting-Ip']);
11
  } else {
12
  return '70e45496';
13
  }
bad-behavior/core.inc.php CHANGED
@@ -78,6 +78,14 @@ function bb2_screen($settings, $package)
78
  // Please proceed to the security checkpoint and have your
79
  // identification and boarding pass ready.
80
 
 
 
 
 
 
 
 
 
81
  // First check the whitelist
82
  require_once(BB2_CORE . "/whitelist.inc.php");
83
  if (!bb2_whitelist($package)) {
@@ -85,13 +93,6 @@ function bb2_screen($settings, $package)
85
  require_once(BB2_CORE . "/blacklist.inc.php");
86
  if ($r = bb2_blacklist($package)) return $r;
87
 
88
- // Check for CloudFlare CDN
89
- if (array_key_exists('Cf-Connecting-Ip', $package['headers_mixed'])) {
90
- require_once(BB2_CORE . "/cloudflare.inc.php");
91
- $r = bb2_cloudflare($package);
92
- if ($r !== false && $r != $package['ip']) return $r;
93
- }
94
-
95
  // Check the http:BL
96
  require_once(BB2_CORE . "/blackhole.inc.php");
97
  if ($r = bb2_httpbl($settings, $package)) return $r;
78
  // Please proceed to the security checkpoint and have your
79
  // identification and boarding pass ready.
80
 
81
+ // Check for CloudFlare CDN since IP to be screened may be different
82
+ // Thanks to J.Miller at Project Honey Pot
83
+ if (array_key_exists('Cf-Connecting-Ip', $package['headers_mixed'])) {
84
+ require_once(BB2_CORE . "/cloudflare.inc.php");
85
+ $r = bb2_cloudflare($package);
86
+ if ($r !== false && $r != $package['ip']) return $r;
87
+ }
88
+
89
  // First check the whitelist
90
  require_once(BB2_CORE . "/whitelist.inc.php");
91
  if (!bb2_whitelist($package)) {
93
  require_once(BB2_CORE . "/blacklist.inc.php");
94
  if ($r = bb2_blacklist($package)) return $r;
95
 
 
 
 
 
 
 
 
96
  // Check the http:BL
97
  require_once(BB2_CORE . "/blackhole.inc.php");
98
  if ($r = bb2_httpbl($settings, $package)) return $r;
bad-behavior/version.inc.php CHANGED
@@ -1,3 +1,3 @@
1
  <?php if (!defined('BB2_CWD')) die("I said no cheating!");
2
- define('BB2_VERSION', "2.1.5");
3
  ?>
1
  <?php if (!defined('BB2_CWD')) die("I said no cheating!");
2
+ define('BB2_VERSION', "2.1.6");
3
  ?>