diff --git a/README.txt b/README.txt index 74288fa..a6b1f03 100644 --- a/README.txt +++ b/README.txt @@ -2,9 +2,9 @@ Tags: comment,trackback,referrer,spam,robot,antispam Contributors: error 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 -Requires at least: 3.1 -Tested up to: 4.0.1 -Stable tag: 2.2.16 +Requires at least: 3.5 +Tested up to: 4.8 +Stable tag: 2.2.19 Bad Behavior prevents spammers from ever delivering their junk, and in many cases, from ever reading your site in the first place. diff --git a/bad-behavior-wordpress-admin.php b/bad-behavior-wordpress-admin.php index 785635e..1f98fe4 100644 --- a/bad-behavior-wordpress-admin.php +++ b/bad-behavior-wordpress-admin.php @@ -9,7 +9,9 @@ function bb2_admin_pages() { add_options_page(__("Bad Behavior"), __("Bad Behavior"), 'manage_options', 'bb2_options', 'bb2_options'); add_options_page(__("Bad Behavior Whitelist"), __("Bad Behavior Whitelist"), 'manage_options', 'bb2_whitelist', 'bb2_whitelist'); add_management_page(__("Bad Behavior Log"), __("Bad Behavior Log"), 'manage_options', 'bb2_manage', 'bb2_manage'); - @session_start(); + if(session_id() == '') { + @session_start(); + } } } @@ -243,6 +245,7 @@ function bb2_whitelist() if (!$request_uri) $request_uri = $_SERVER['SCRIPT_NAME']; # IIS if ($_POST) { + check_admin_referer('bad-behavior-whitelist'); $_POST = array_map('stripslashes_deep', $_POST); if ($_POST['ip']) { $whitelists['ip'] = array_filter(preg_split("/\s+/m", $_POST['ip'])); @@ -277,18 +280,20 @@ function bb2_whitelist()

- +

- +

- +
+ +

@@ -304,6 +309,7 @@ function bb2_options() if (!$request_uri) $request_uri = $_SERVER['SCRIPT_NAME']; # IIS if ($_POST) { + check_admin_referer('bad-behavior-options'); $_POST = array_map('stripslashes_deep', $_POST); if ($_POST['display_stats']) { $settings['display_stats'] = true; @@ -438,6 +444,8 @@ function bb2_options()