Version Description
Download this release
Release Info
Developer | error |
Plugin | Bad Behavior |
Version | 2.2.4 |
Comparing to | |
See all releases |
Code changes from version 2.2.3 to 2.2.4
- README.txt +2 -2
- bad-behavior-generic.php +4 -0
- bad-behavior-mediawiki.php +1 -0
- bad-behavior-wordpress-admin.php +11 -0
- bad-behavior-wordpress.php +2 -2
- bad-behavior/core.inc.php +1 -1
- bad-behavior/screener.inc.php +3 -1
- settings-sample.ini +1 -0
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.3.
|
7 |
-
Stable tag: 2.2.
|
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.2
|
7 |
+
Stable tag: 2.2.4
|
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-generic.php
CHANGED
@@ -38,6 +38,10 @@ $bb2_settings_defaults = array(
|
|
38 |
'httpbl_threat' => '25',
|
39 |
'httpbl_maxage' => '30',
|
40 |
'offsite_forms' => false,
|
|
|
|
|
|
|
|
|
41 |
);
|
42 |
|
43 |
// Bad Behavior callback functions.
|
38 |
'httpbl_threat' => '25',
|
39 |
'httpbl_maxage' => '30',
|
40 |
'offsite_forms' => false,
|
41 |
+
'eu_cookie' => false,
|
42 |
+
'reverse_proxy' => false,
|
43 |
+
'reverse_proxy_header' => 'X-Forwarded-For',
|
44 |
+
'reverse_proxy_addresses' => array(),
|
45 |
);
|
46 |
|
47 |
// Bad Behavior callback functions.
|
bad-behavior-mediawiki.php
CHANGED
@@ -41,6 +41,7 @@ $bb2_settings_defaults = array(
|
|
41 |
'httpbl_threat' => '25',
|
42 |
'httpbl_maxage' => '30',
|
43 |
'offsite_forms' => false,
|
|
|
44 |
'reverse_proxy' => false,
|
45 |
'reverse_proxy_header' => 'X-Forwarded-For',
|
46 |
'reverse_proxy_addresses' => array(),
|
41 |
'httpbl_threat' => '25',
|
42 |
'httpbl_maxage' => '30',
|
43 |
'offsite_forms' => false,
|
44 |
+
'eu_cookie' => false,
|
45 |
'reverse_proxy' => false,
|
46 |
'reverse_proxy_header' => 'X-Forwarded-For',
|
47 |
'reverse_proxy_addresses' => array(),
|
bad-behavior-wordpress-admin.php
CHANGED
@@ -355,6 +355,11 @@ function bb2_options()
|
|
355 |
} else {
|
356 |
$settings['offsite_forms'] = false;
|
357 |
}
|
|
|
|
|
|
|
|
|
|
|
358 |
if ($_POST['reverse_proxy']) {
|
359 |
$settings['reverse_proxy'] = true;
|
360 |
} else {
|
@@ -412,6 +417,12 @@ function bb2_options()
|
|
412 |
<tr><td><label><input type="text" size="3" maxlength="3" name="httpbl_maxage" value="<?php echo $settings['httpbl_maxage']; ?>" /> Maximum Age of Data (30 is recommended)</label></td></tr>
|
413 |
</table>
|
414 |
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
<h3><?php _e('Reverse Proxy/Load Balancer'); ?></h3>
|
416 |
<p>If you are using Bad Behavior behind a reverse proxy, load balancer, HTTP accelerator, content cache or similar technology, enable the Reverse Proxy option.</p>
|
417 |
<p>If you have a chain of two or more reverse proxies between your server and the public Internet, you must specify <em>all</em> of the IP address ranges (in CIDR format) of all of your proxy servers, load balancers, etc. Otherwise, Bad Behavior may be unable to determine the client's true IP address.</p>
|
355 |
} else {
|
356 |
$settings['offsite_forms'] = false;
|
357 |
}
|
358 |
+
if ($_POST['eu_cookie']) {
|
359 |
+
$settings['eu_cookie'] = true;
|
360 |
+
} else {
|
361 |
+
$settings['eu_cookie'] = false;
|
362 |
+
}
|
363 |
if ($_POST['reverse_proxy']) {
|
364 |
$settings['reverse_proxy'] = true;
|
365 |
} else {
|
417 |
<tr><td><label><input type="text" size="3" maxlength="3" name="httpbl_maxage" value="<?php echo $settings['httpbl_maxage']; ?>" /> Maximum Age of Data (30 is recommended)</label></td></tr>
|
418 |
</table>
|
419 |
|
420 |
+
<h3><?php _e('European Union Cookie'); ?></h3>
|
421 |
+
<p>Select this option if you believe Bad Behavior's site security cookie is not exempt from the 2012 EU cookie regulation. <a href="http://bad-behavior.ioerror.us/2012/05/03/bad-behavior-2-2-4/">More info</a></p>
|
422 |
+
<table class="form-table">
|
423 |
+
<tr><td><label><input type="checkbox" name="eu_cookie" value="true" <?php if ($settings['eu_cookie']) { ?>checked="checked" <?php } ?>/> <?php _e('EU cookie handling'); ?></label></td></tr>
|
424 |
+
</table>
|
425 |
+
|
426 |
<h3><?php _e('Reverse Proxy/Load Balancer'); ?></h3>
|
427 |
<p>If you are using Bad Behavior behind a reverse proxy, load balancer, HTTP accelerator, content cache or similar technology, enable the Reverse Proxy option.</p>
|
428 |
<p>If you have a chain of two or more reverse proxies between your server and the public Internet, you must specify <em>all</em> of the IP address ranges (in CIDR format) of all of your proxy servers, load balancers, etc. Otherwise, Bad Behavior may be unable to determine the client's true IP address.</p>
|
bad-behavior-wordpress.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Bad Behavior
|
4 |
-
Version: 2.2.
|
5 |
Description: Deny automated spambots access to your PHP-based Web site.
|
6 |
Plugin URI: http://bad-behavior.ioerror.us/
|
7 |
Author: Michael Hampton
|
@@ -109,7 +109,7 @@ function bb2_read_settings() {
|
|
109 |
// Add in default settings when they aren't yet present in WP
|
110 |
$settings = get_option('bad_behavior_settings');
|
111 |
if (!$settings) $settings = array();
|
112 |
-
return array_merge(array('log_table' => $wpdb->prefix . 'bad_behavior', 'display_stats' => true, 'strict' => false, 'verbose' => false, 'logging' => true, 'httpbl_key' => '', 'httpbl_threat' => '25', 'httpbl_maxage' => '30', 'offsite_forms' => false, 'reverse_proxy' => false, 'reverse_proxy_header' => 'X-Forwarded-For', 'reverse_proxy_addresses' => array(),), $settings);
|
113 |
|
114 |
|
115 |
}
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Bad Behavior
|
4 |
+
Version: 2.2.4
|
5 |
Description: Deny automated spambots access to your PHP-based Web site.
|
6 |
Plugin URI: http://bad-behavior.ioerror.us/
|
7 |
Author: Michael Hampton
|
109 |
// Add in default settings when they aren't yet present in WP
|
110 |
$settings = get_option('bad_behavior_settings');
|
111 |
if (!$settings) $settings = array();
|
112 |
+
return array_merge(array('log_table' => $wpdb->prefix . 'bad_behavior', 'display_stats' => true, 'strict' => false, 'verbose' => false, 'logging' => true, 'httpbl_key' => '', 'httpbl_threat' => '25', 'httpbl_maxage' => '30', 'offsite_forms' => false, 'eu_cookie' => false, 'reverse_proxy' => false, 'reverse_proxy_header' => 'X-Forwarded-For', 'reverse_proxy_addresses' => array(),), $settings);
|
113 |
|
114 |
|
115 |
}
|
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.2.
|
3 |
|
4 |
// Bad Behavior entry point is bb2_start()
|
5 |
// If you're reading this, you are probably lost.
|
1 |
<?php if (!defined('BB2_CWD')) die("I said no cheating!");
|
2 |
+
define('BB2_VERSION', "2.2.4");
|
3 |
|
4 |
// Bad Behavior entry point is bb2_start()
|
5 |
// If you're reading this, you are probably lost.
|
bad-behavior/screener.inc.php
CHANGED
@@ -5,7 +5,9 @@
|
|
5 |
function bb2_screener_cookie($settings, $package, $cookie_name, $cookie_value)
|
6 |
{
|
7 |
// FIXME: Set the real cookie
|
8 |
-
|
|
|
|
|
9 |
}
|
10 |
|
11 |
function bb2_screener_javascript($settings, $package, $cookie_name, $cookie_value)
|
5 |
function bb2_screener_cookie($settings, $package, $cookie_name, $cookie_value)
|
6 |
{
|
7 |
// FIXME: Set the real cookie
|
8 |
+
if (!$settings['eu_cookie']) {
|
9 |
+
setcookie($cookie_name, $cookie_value, 0, bb2_relative_path());
|
10 |
+
}
|
11 |
}
|
12 |
|
13 |
function bb2_screener_javascript($settings, $package, $cookie_name, $cookie_value)
|
settings-sample.ini
CHANGED
@@ -9,6 +9,7 @@ httpbl_key = ""
|
|
9 |
httpbl_threat = 25
|
10 |
httpbl_maxage = 30
|
11 |
offsite_forms = false
|
|
|
12 |
reverse_proxy = false
|
13 |
reverse_proxy_header = "X-Forwarded-For"
|
14 |
;reverse_proxy_addresses[] =
|
9 |
httpbl_threat = 25
|
10 |
httpbl_maxage = 30
|
11 |
offsite_forms = false
|
12 |
+
eu_cookie = false
|
13 |
reverse_proxy = false
|
14 |
reverse_proxy_header = "X-Forwarded-For"
|
15 |
;reverse_proxy_addresses[] =
|