Bad Behavior - Version 2.1.13

Version Description

Download this release

Release Info

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

Code changes from version 2.1.12 to 2.1.13

bad-behavior-generic.php CHANGED
@@ -96,7 +96,7 @@ function bb2_email() {
96
  function bb2_read_settings() {
97
  global $bb2_settings_defaults;
98
  $settings = @parse_ini_file(dirname(__FILE__) . "/settings.ini");
99
- return array_merge($bb2_settings_defaults, $settings);
100
  }
101
 
102
  // write settings to database
96
  function bb2_read_settings() {
97
  global $bb2_settings_defaults;
98
  $settings = @parse_ini_file(dirname(__FILE__) . "/settings.ini");
99
+ return @array_merge($bb2_settings_defaults, $settings);
100
  }
101
 
102
  // write settings to database
bad-behavior-wordpress.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Bad Behavior
4
- Version: 2.1.12
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.13
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/core.inc.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php if (!defined('BB2_CWD')) die("I said no cheating!");
2
- define('BB2_VERSION', "2.1.12");
3
 
4
  // Bad Behavior entry point is bb2_start()
5
  // If you're reading this, you are probably lost.
@@ -141,18 +141,21 @@ function bb2_screen($settings, $package)
141
  if ($r == 1) return false; # whitelisted
142
  return $r;
143
  }
 
144
  } elseif (stripos($ua, "Googlebot") !== FALSE || stripos($ua, "Mediapartners-Google") !== FALSE) {
145
  require_once(BB2_CORE . "/searchengine.inc.php");
146
  if ($r = bb2_google($package)) {
147
  if ($r == 1) return false; # whitelisted
148
  return $r;
149
  }
 
150
  } elseif (stripos($ua, "Yahoo! Slurp") !== FALSE || stripos($ua, "Yahoo! SearchMonkey") !== FALSE) {
151
  require_once(BB2_CORE . "/searchengine.inc.php");
152
  if ($r = bb2_yahoo($package)) {
153
  if ($r == 1) return false; # whitelisted
154
  return $r;
155
  }
 
156
  }
157
  // MSIE checks
158
  if (stripos($ua, "; MSIE") !== FALSE) {
1
  <?php if (!defined('BB2_CWD')) die("I said no cheating!");
2
+ define('BB2_VERSION', "2.1.13");
3
 
4
  // Bad Behavior entry point is bb2_start()
5
  // If you're reading this, you are probably lost.
141
  if ($r == 1) return false; # whitelisted
142
  return $r;
143
  }
144
+ return false;
145
  } elseif (stripos($ua, "Googlebot") !== FALSE || stripos($ua, "Mediapartners-Google") !== FALSE) {
146
  require_once(BB2_CORE . "/searchengine.inc.php");
147
  if ($r = bb2_google($package)) {
148
  if ($r == 1) return false; # whitelisted
149
  return $r;
150
  }
151
+ return false;
152
  } elseif (stripos($ua, "Yahoo! Slurp") !== FALSE || stripos($ua, "Yahoo! SearchMonkey") !== FALSE) {
153
  require_once(BB2_CORE . "/searchengine.inc.php");
154
  if ($r = bb2_yahoo($package)) {
155
  if ($r == 1) return false; # whitelisted
156
  return $r;
157
  }
158
+ return false;
159
  }
160
  // MSIE checks
161
  if (stripos($ua, "; MSIE") !== FALSE) {
bad-behavior/searchengine.inc.php CHANGED
@@ -6,7 +6,7 @@ require_once(BB2_CORE . "/roundtripdns.inc.php");
6
 
7
  function bb2_google($package)
8
  {
9
- if (match_cidr($package['ip'], array("66.249.64.0/19", "64.233.160.0/19", "72.14.192.0/18", "203.208.32.0/19")) === FALSE) {
10
  return "f1182195";
11
  }
12
  # Disabled due to http://bugs.php.net/bug.php?id=53092
6
 
7
  function bb2_google($package)
8
  {
9
+ if (match_cidr($package['ip'], array("66.249.64.0/19", "64.233.160.0/19", "72.14.192.0/18", "203.208.32.0/19", "74.125.0.0/16", "216.239.32.0/19")) === FALSE) {
10
  return "f1182195";
11
  }
12
  # Disabled due to http://bugs.php.net/bug.php?id=53092