X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/ff81ee6e8304a1982a3ec4f5b134764a29d502cf..refs/tags/wordpress-2.0.4:/wp-content/plugins/akismet/akismet.php diff --git a/wp-content/plugins/akismet/akismet.php b/wp-content/plugins/akismet/akismet.php index 6adb649b..8d8997ab 100644 --- a/wp-content/plugins/akismet/akismet.php +++ b/wp-content/plugins/akismet/akismet.php @@ -4,21 +4,37 @@ Plugin Name: Akismet Plugin URI: http://akismet.com/ Description: Akismet checks your comments against the Akismet web serivce to see if they look like spam or not. You need a WordPress.com API key to use this service. You can review the spam it catches under "Manage" and it automatically deletes old spam after 15 days. Hat tip: Michael Hampton and Chris J. Davis for help with the plugin. Author: Matt Mullenweg -Version: 1.14 +Version: 1.15 Author URI: http://photomatt.net/ */ add_action('admin_menu', 'ksd_config_page'); +if ( ! function_exists('wp_nonce_field') ) { + function akismet_nonce_field($action = -1) { + return; + } + $akismet_nonce = -1; +} else { + function akismet_nonce_field($action = -1) { + return wp_nonce_field($action); + } + $akismet_nonce = 'akismet-update-key'; +} + function ksd_config_page() { global $wpdb; if ( function_exists('add_submenu_page') ) - add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 1, __FILE__, 'akismet_conf'); + add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', __FILE__, 'akismet_conf'); } function akismet_conf() { + global $akismet_nonce; if ( isset($_POST['submit']) ) { - check_admin_referer(); + if ( !current_user_can('manage_options') ) + die(__('Cheatin’ uh?')); + + check_admin_referer($akismet_nonce); $key = preg_replace('/[^a-h0-9]/i', '', $_POST['key']); if ( akismet_verify_key( $key ) ) update_option('wordpress_api_key', $key); @@ -34,6 +50,7 @@ function akismet_conf() {
Akismet will greatly reduce or even completely eliminate the comment and trackback spam you get on your site. If one does happen to get through, simply mark it as "spam" on the moderation screen and Akismet will learn from the mistakes. If you don\'t have a WordPress.com account yet, you can get one at WordPress.com.'), 'http://akismet.com/', 'http://wordpress.com/api-keys/'); ?>