Adding support for a proxy-specific RBL that has shown to be extremely effective
git-svn-id: http://svn.automattic.com/wordpress/trunk@2199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f924bec2f3
commit
30213a51c1
|
@ -22,7 +22,7 @@ if ($action == 'retrospam') {
|
||||||
<h2><?php _e('Discussion Options') ?></h2>
|
<h2><?php _e('Discussion Options') ?></h2>
|
||||||
<form name="form1" method="post" action="options.php">
|
<form name="form1" method="post" action="options.php">
|
||||||
<input type="hidden" name="action" value="update" />
|
<input type="hidden" name="action" value="update" />
|
||||||
<input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','require_name_email','comment_whitelist','comment_max_links','moderation_keys','blacklist_keys'" />
|
<input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','require_name_email','comment_whitelist','comment_max_links','moderation_keys','blacklist_keys','open_proxy_check'" />
|
||||||
<fieldset class="options">
|
<fieldset class="options">
|
||||||
<legend><?php _e('Usual settings for an article: <em>(These settings may be overridden for individual articles.)</em>') ?></legend>
|
<legend><?php _e('Usual settings for an article: <em>(These settings may be overridden for individual articles.)</em>') ?></legend>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -88,6 +88,9 @@ if ($action == 'retrospam') {
|
||||||
<p>
|
<p>
|
||||||
<textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>
|
<textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea>
|
||||||
</p>
|
</p>
|
||||||
|
<p><label for="open_proxy_check">
|
||||||
|
<input name="open_proxy_check" type="checkbox" id="open_proxy_check" value="open" <?php checked('1', get_settings('open_proxy_check')); ?> />
|
||||||
|
<?php _e('Blacklist comments from open and insecure proxies.)') ?></label></p>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<input type="submit" name="Submit" value="<?php _e('Update Options') ?>" />
|
<input type="submit" name="Submit" value="<?php _e('Update Options') ?>" />
|
||||||
|
|
|
@ -214,6 +214,7 @@ function populate_options() {
|
||||||
add_option('page_uris');
|
add_option('page_uris');
|
||||||
add_option('blacklist_keys');
|
add_option('blacklist_keys');
|
||||||
add_option('comment_registration', 0);
|
add_option('comment_registration', 0);
|
||||||
|
add_option('open_proxy_check', 1);
|
||||||
|
|
||||||
// Delete unused options
|
// Delete unused options
|
||||||
$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'rss_language', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl');
|
$unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'rss_language', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl');
|
||||||
|
|
|
@ -418,6 +418,13 @@ function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_age
|
||||||
if ( preg_match($pattern, $user_agent) ) return true;
|
if ( preg_match($pattern, $user_agent) ) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( get_option('open_proxy_check') && isset($_SERVER['REMOTE_ADDR']) ) {
|
||||||
|
$rev_ip = implode( '.', array_reverse( explode( '.', $_SERVER['REMOTE_ADDR'] ) ) );
|
||||||
|
$lookup = $rev_ip . '.opm.blitzed.org';
|
||||||
|
if ( $lookup != gethostbyname( $lookup ) )
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue