Version Description
Download this release
Release Info
Developer | error |
Plugin | Bad Behavior |
Version | 2.1.16 |
Comparing to | |
See all releases |
Code changes from version 2.1.15 to 2.1.16
- README.txt +2 -2
- bad-behavior-mediawiki.php +1 -1
- bad-behavior-wordpress-admin.php +1 -1
- bad-behavior-wordpress.php +2 -1
- bad-behavior/core.inc.php +4 -2
- whitelist-sample.ini +1 -1
README.txt
CHANGED
@@ -3,8 +3,8 @@ Tags: comment,trackback,referrer,spam,robot,antispam
|
|
3 |
Contributors: error, markjaquith, skeltoac
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=error%40ioerror%2eus&item_name=Bad%20Behavior%20%28From%20WordPress%20Page%29&no_shipping=1&cn=Comments%20about%20Bad%20Behavior&tax=0¤cy_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8
|
5 |
Requires at least: 2.7
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 2.1.
|
8 |
|
9 |
Bad Behavior prevents spammers from ever delivering their junk, and in many
|
10 |
cases, from ever reading your site in the first place.
|
3 |
Contributors: error, markjaquith, skeltoac
|
4 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=error%40ioerror%2eus&item_name=Bad%20Behavior%20%28From%20WordPress%20Page%29&no_shipping=1&cn=Comments%20about%20Bad%20Behavior&tax=0¤cy_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8
|
5 |
Requires at least: 2.7
|
6 |
+
Tested up to: 3.3.1
|
7 |
+
Stable tag: 2.1.16
|
8 |
|
9 |
Bad Behavior prevents spammers from ever delivering their junk, and in many
|
10 |
cases, from ever reading your site in the first place.
|
bad-behavior-mediawiki.php
CHANGED
@@ -99,7 +99,7 @@ function bb2_email() {
|
|
99 |
function bb2_read_settings() {
|
100 |
global $bb2_settings_defaults;
|
101 |
$settings = @parse_ini_file(dirname(__FILE__) . "/settings.ini");
|
102 |
-
return array_merge($bb2_settings_defaults, $settings);
|
103 |
}
|
104 |
|
105 |
// This Bad Behavior-related function is a stub. You can help MediaWiki by expanding it.
|
99 |
function bb2_read_settings() {
|
100 |
global $bb2_settings_defaults;
|
101 |
$settings = @parse_ini_file(dirname(__FILE__) . "/settings.ini");
|
102 |
+
return @array_merge($bb2_settings_defaults, $settings);
|
103 |
}
|
104 |
|
105 |
// This Bad Behavior-related function is a stub. You can help MediaWiki by expanding it.
|
bad-behavior-wordpress-admin.php
CHANGED
@@ -175,7 +175,7 @@ Displaying all <strong><?php echo $totalcount; ?></strong> records<br/>
|
|
175 |
}
|
176 |
echo "<th scope=\"row\" class=\"check-column\"><input type=\"checkbox\" name=\"submit[]\" value=\"" . $result["id"] . "\" /></th>\n";
|
177 |
$httpbl = bb2_httpbl_lookup($result["ip"]);
|
178 |
-
$host = gethostbyaddr($result["ip"]);
|
179 |
if (!strcmp($host, $result["ip"])) {
|
180 |
$host = "";
|
181 |
} else {
|
175 |
}
|
176 |
echo "<th scope=\"row\" class=\"check-column\"><input type=\"checkbox\" name=\"submit[]\" value=\"" . $result["id"] . "\" /></th>\n";
|
177 |
$httpbl = bb2_httpbl_lookup($result["ip"]);
|
178 |
+
$host = @gethostbyaddr($result["ip"]);
|
179 |
if (!strcmp($host, $result["ip"])) {
|
180 |
$host = "";
|
181 |
} else {
|
bad-behavior-wordpress.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Bad Behavior
|
4 |
-
Version: 2.1.
|
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
|
@@ -164,6 +164,7 @@ if (is_admin() || strstr($_SERVER['PHP_SELF'], 'wp-admin/')) { // 1.5 kludge
|
|
164 |
require_once(BB2_CWD . "/bad-behavior-wordpress-admin.php");
|
165 |
}
|
166 |
|
|
|
167 |
$_SESSION['BB2_RESULT'] = bb2_start(bb2_read_settings());
|
168 |
|
169 |
$bb2_mtime = explode(" ", microtime());
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Bad Behavior
|
4 |
+
Version: 2.1.16
|
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
|
164 |
require_once(BB2_CWD . "/bad-behavior-wordpress-admin.php");
|
165 |
}
|
166 |
|
167 |
+
if (!$_SESSION) session_start();
|
168 |
$_SESSION['BB2_RESULT'] = bb2_start(bb2_read_settings());
|
169 |
|
170 |
$bb2_mtime = explode(" ", microtime());
|
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.
|
3 |
|
4 |
// Bad Behavior entry point is bb2_start()
|
5 |
// If you're reading this, you are probably lost.
|
@@ -44,7 +44,9 @@ function bb2_approved($settings, $package)
|
|
44 |
function bb2_reverse_proxy($settings, $headers_mixed)
|
45 |
{
|
46 |
$addrs = array_reverse(preg_split("/[\s,]+/", $headers_mixed[$settings['reverse_proxy_header']]));
|
47 |
-
if (
|
|
|
|
|
48 |
foreach ($addrs as $addr) {
|
49 |
if (!match_cidr($addr, $settings['reverse_proxy_addresses'])) {
|
50 |
return $addr;
|
1 |
<?php if (!defined('BB2_CWD')) die("I said no cheating!");
|
2 |
+
define('BB2_VERSION', "2.1.16");
|
3 |
|
4 |
// Bad Behavior entry point is bb2_start()
|
5 |
// If you're reading this, you are probably lost.
|
44 |
function bb2_reverse_proxy($settings, $headers_mixed)
|
45 |
{
|
46 |
$addrs = array_reverse(preg_split("/[\s,]+/", $headers_mixed[$settings['reverse_proxy_header']]));
|
47 |
+
if (empty($addrs)) {
|
48 |
+
$addrs[] = $_SERVER['REMOTE_ADDR'];
|
49 |
+
} else if (!empty($settings['reverse_proxy_addresses'])) {
|
50 |
foreach ($addrs as $addr) {
|
51 |
if (!match_cidr($addr, $settings['reverse_proxy_addresses'])) {
|
52 |
return $addr;
|
whitelist-sample.ini
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
|
9 |
[ip]
|
10 |
; Digg whitelisted as of 2.0.12
|
11 |
-
ip[] = "64.191.203.
|
12 |
ip[] = "208.67.217.130"
|
13 |
; RFC 1918 addresses
|
14 |
ip[] = "10.0.0.0/8"
|
8 |
|
9 |
[ip]
|
10 |
; Digg whitelisted as of 2.0.12
|
11 |
+
ip[] = "64.191.203.0/24"
|
12 |
ip[] = "208.67.217.130"
|
13 |
; RFC 1918 addresses
|
14 |
ip[] = "10.0.0.0/8"
|