Bad Behavior - Version 2.2.24

Version Description

Download this release

Release Info

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

Code changes from version 2.2.23 to 2.2.24

README.txt CHANGED
@@ -3,8 +3,8 @@ Tags: comment,trackback,referrer,spam,robot,antispam
3
  Contributors: error
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&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8
5
  Requires at least: 3.5
6
- Tested up to: 5.2.2
7
- Stable tag: 2.2.23
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
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&currency_code=USD&bn=PP%2dDonationsBF&charset=UTF%2d8
5
  Requires at least: 3.5
6
+ Tested up to: 5.3.0
7
+ Stable tag: 2.2.24
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-wordpress-admin.php CHANGED
@@ -125,12 +125,12 @@ function bb2_manage() {
125
 
126
  // Get query variables desired by the user with input validation
127
  $paged = 0 + $_GET['paged']; if (!$paged) $paged = 1;
128
- if ($_GET['key']) $where .= "AND `key` = '" . $wpdb->escape($_GET['key']) . "' ";
129
  if ($_GET['blocked']) $where .= "AND `key` != '00000000' ";
130
  else if ($_GET['permitted']) $where .= "AND `key` = '00000000' ";
131
- if ($_GET['ip']) $where .= "AND `ip` = '" . $wpdb->escape($_GET['ip']) . "' ";
132
- if ($_GET['user_agent']) $where .= "AND `user_agent` = '" . $wpdb->escape($_GET['user_agent']) . "' ";
133
- if ($_GET['request_method']) $where .= "AND `request_method` = '" . $wpdb->escape($_GET['request_method']) . "' ";
134
 
135
  // Query the DB based on variables selected
136
  $r = bb2_db_query("SELECT COUNT(id) FROM `" . $settings['log_table']);
@@ -427,6 +427,7 @@ function bb2_options()
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>
429
  <p>In addition, your reverse proxy servers must set the IP address of the Internet client from which they received the request in an HTTP header. If you don't specify a header, <a href="https://en.wikipedia.org/wiki/X-Forwarded-For">X-Forwarded-For</a> will be used. Most proxy servers already support X-Forwarded-For and you would then only need to ensure that it is enabled on your proxy servers. Some other header names in common use include <u>X-Real-Ip</u> (nginx) and <u>Cf-Connecting-Ip</u> (CloudFlare).</p>
 
430
  <table class="form-table">
431
  <tr><td><label><input type="checkbox" name="reverse_proxy" value="true" <?php if ($settings['reverse_proxy']) { ?>checked="checked" <?php } ?>/> <?php _e('Enable Reverse Proxy'); ?></label></td></tr>
432
  <tr><td><label><input type="text" size="32" name="reverse_proxy_header" value="<?php echo sanitize_text_field($settings['reverse_proxy_header']); ?>" /> Header containing Internet clients' IP address</label></td></tr>
125
 
126
  // Get query variables desired by the user with input validation
127
  $paged = 0 + $_GET['paged']; if (!$paged) $paged = 1;
128
+ if ($_GET['key']) $where .= "AND `key` = '" . esc_sql($_GET['key']) . "' ";
129
  if ($_GET['blocked']) $where .= "AND `key` != '00000000' ";
130
  else if ($_GET['permitted']) $where .= "AND `key` = '00000000' ";
131
+ if ($_GET['ip']) $where .= "AND `ip` = '" . esc_sql($_GET['ip']) . "' ";
132
+ if ($_GET['user_agent']) $where .= "AND `user_agent` = '" . esc_sql($_GET['user_agent']) . "' ";
133
+ if ($_GET['request_method']) $where .= "AND `request_method` = '" . esc_sql($_GET['request_method']) . "' ";
134
 
135
  // Query the DB based on variables selected
136
  $r = bb2_db_query("SELECT COUNT(id) FROM `" . $settings['log_table']);
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>
429
  <p>In addition, your reverse proxy servers must set the IP address of the Internet client from which they received the request in an HTTP header. If you don't specify a header, <a href="https://en.wikipedia.org/wiki/X-Forwarded-For">X-Forwarded-For</a> will be used. Most proxy servers already support X-Forwarded-For and you would then only need to ensure that it is enabled on your proxy servers. Some other header names in common use include <u>X-Real-Ip</u> (nginx) and <u>Cf-Connecting-Ip</u> (CloudFlare).</p>
430
+ <p>Note: This option is not required if reverse proxy IP address handing is configured in your web server, e.g. with Apache mod_remoteip or Nginx realip, but it is safe to enable it anyway if you are not sure about the web server configuration.</p>
431
  <table class="form-table">
432
  <tr><td><label><input type="checkbox" name="reverse_proxy" value="true" <?php if ($settings['reverse_proxy']) { ?>checked="checked" <?php } ?>/> <?php _e('Enable Reverse Proxy'); ?></label></td></tr>
433
  <tr><td><label><input type="text" size="32" name="reverse_proxy_header" value="<?php echo sanitize_text_field($settings['reverse_proxy_header']); ?>" /> Header containing Internet clients' IP address</label></td></tr>
bad-behavior-wordpress.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Bad Behavior
4
- Version: 2.2.23
5
  Description: Deny automated spambots access to your PHP-based Web site.
6
  Plugin URI: https://bad-behavior.ioerror.us/
7
  Author: Michael Hampton
1
  <?php
2
  /*
3
  Plugin Name: Bad Behavior
4
+ Version: 2.2.24
5
  Description: Deny automated spambots access to your PHP-based Web site.
6
  Plugin URI: https://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.2.22");
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.24");
3
 
4
  // Bad Behavior entry point is bb2_start()
5
  // If you're reading this, you are probably lost.