diff -crB wp-ban.orig/ban-options.php wp-ban/ban-options.php
*** wp-ban.orig/ban-options.php	Mon Jun  8 03:37:55 2009
--- wp-ban/ban-options.php	Sat Sep  5 23:10:42 2009
***************
*** 43,48 ****
--- 43,49 ----
  	$banned_referers_post = explode("\n", trim($_POST['banned_referers']));
  	$banned_user_agents_post = explode("\n", trim($_POST['banned_user_agents']));
  	$banned_exclude_ips_post = explode("\n", trim($_POST['banned_exclude_ips']));
+ 	$banned_bad_urls_post = explode("\n", trim($_POST['banned_bad_urls']));
  	$banned_message = trim($_POST['banned_template_message']);
  	if(!empty($banned_ips_post)) {
  		$banned_ips = array();
***************
*** 103,108 ****
--- 104,116 ----
  			$banned_exclude_ips[] = trim($banned_exclude_ip);
  		}
  	}
+ 	// http://www.microshell.com/website_internet/security/updating-wp-ban-to-include-bad-urls
+ 	if(!empty($banned_bad_urls_post)) {
+ 		$banned_bad_urls = array();
+ 		foreach($banned_bad_urls_post as $banned_bad_url) {
+ 			$banned_bad_urls[] = trim($banned_bad_url);
+ 		}
+ 	}
  	$update_ban_queries[] = update_option('banned_ips', $banned_ips);
  	$update_ban_queries[] = update_option('banned_ips_range', $banned_ips_range);
  	$update_ban_queries[] = update_option('banned_hosts', $banned_hosts);
***************
*** 110,115 ****
--- 118,124 ----
  	$update_ban_queries[] = update_option('banned_user_agents', $banned_user_agents);
  	$update_ban_queries[] = update_option('banned_exclude_ips', $banned_exclude_ips);
  	$update_ban_queries[] = update_option('banned_message', $banned_message);
+ 	$update_ban_queries[] = update_option('banned_bad_urls', $banned_bad_urls);
  	$update_ban_text[] = __('Banned IPs', 'wp-ban');
  	$update_ban_text[] = __('Banned IP Range', 'wp-ban');
  	$update_ban_text[] = __('Banned Host Names', 'wp-ban');
***************
*** 117,122 ****
--- 126,132 ----
  	$update_ban_text[] = __('Banned User Agents', 'wp-ban');
  	$update_ban_text[] = __('Banned Excluded IPs', 'wp-ban');
  	$update_ban_text[] = __('Banned Message', 'wp-ban');
+ 	$update_ban_text[] = __('Banned Bad URLs', 'wp-ban');
  	$i=0;
  	foreach($update_ban_queries as $update_ban_query) {
  		if($update_ban_query) {
***************
*** 194,204 ****
--- 204,216 ----
  		$banned_referers = get_option('banned_referers');
  		$banned_user_agents = get_option('banned_user_agents');
  		$banned_exclude_ips = get_option('banned_exclude_ips');
+ 		$banned_bad_urls = get_option('banned_bad_urls');
  		$banned_ips_display = '';
  		$banned_ips_range_display = '';
  		$banned_hosts_display = '';
  		$banned_referers_display = '';
  		$banned_exclude_ips_display = '';
+ 		$banned_bad_urls_display = '';
  		if(!empty($banned_ips)) {
  			foreach($banned_ips as $banned_ip) {
  				$banned_ips_display .= $banned_ip."\n";
***************
*** 229,234 ****
--- 241,252 ----
  				$banned_exclude_ips_display .= $banned_exclude_ip."\n";
  			}
  		}
+ 		// http://www.microshell.com/website_internet/security/updating-wp-ban-to-include-bad-urls
+ 		if(!empty($banned_bad_urls)) {
+ 			foreach($banned_bad_urls as $banned_bad_url) {
+ 				$banned_bad_urls_display .= $banned_bad_url."\n";
+ 			}
+ 		}
  		$banned_ips_display = trim($banned_ips_display);
  		$banned_ips_range_display = trim($banned_ips_range_display);
  		$banned_hosts_display = trim($banned_hosts_display);
***************
*** 407,412 ****
--- 425,445 ----
  				<textarea cols="60" rows="20" id="banned_template_message" name="banned_template_message"><?php echo stripslashes(get_option('banned_message')); ?></textarea>
  			</td>
  		</tr>
+ <?php // http://www.microshell.com/website_internet/security/updating-wp-ban-to-include-bad-urls ?>
+ 		<tr>
+ 			<td valign="top">
+ 				<strong><?php _e('Banned Bad URLs', 'wp-ban'); ?>:</strong><br />
+ 				<?php _e('Start each entry on a new line.', 'wp-ban'); ?><br /><br />
+ 				<?php _e('Examples:', 'wp-ban'); ?><br />
+ 				<strong>&raquo;</strong> <span dir="ltr">includedir=http://</span><br /><br />
+ 				<?php _e('Notes:', 'wp-ban'); ?><br />
+ 				<strong>&raquo;</strong> <?php _e('Will match part of request URLs.', 'wp-ban'); ?><br />
+ 				<strong>&raquo;</strong> <?php _e('Make sure it\'s unique enough that it doesn\'t match your post URLs.', 'wp-ban'); ?>
+ 			</td>
+ 			<td>
+ 				<textarea cols="40" rows="10" name="banned_bad_urls" dir="ltr"><?php echo $banned_bad_urls_display; ?></textarea>
+ 			</td>
+ 		</tr>
  	</table>
  	<p class="submit">
  		<input type="submit" name="Submit" class="button" value="<?php _e('Save Changes', 'wp-ban'); ?>" />
***************
*** 503,506 ****
  </form>
  <?php
  } // End switch($mode)
! ?>
\ No newline at end of file
--- 536,539 ----
  </form>
  <?php
  } // End switch($mode)
! ?>
diff -crB wp-ban.orig/wp-ban.php wp-ban/wp-ban.php
*** wp-ban.orig/wp-ban.php	Mon Jun  8 03:37:55 2009
--- wp-ban/wp-ban.php	Sat Sep  5 23:08:40 2009
***************
*** 115,120 ****
--- 115,136 ----
  }
  
  
+ ### Function: Process Banned Bad URL
+ ### http://www.microshell.com/website_internet/security/updating-wp-ban-to-include-bad-urls
+ function process_ban_bad_url($banned_bad_urls, $against) {
+ 	// We should never ban wp-admin.
+ 	if(!empty($banned_bad_urls) && !preg_match('/^\/wp-admin/', $against)) {
+ 		foreach($banned_bad_urls as $banned_bad_url) {
+ 			// Let's never ban wp-admin URLs.
+ 			if (strstr($against, $banned_bad_url) !== false) {
+ 				print_banned_message();
+ 				break;
+ 			}
+ 		}
+ 	}
+ }
+ 
+ 
  ### Function: Banned
  add_action('init', 'banned');
  function banned() {
***************
*** 128,133 ****
--- 144,150 ----
  	$banned_referers = get_option('banned_referers');
  	$banned_user_agents = get_option('banned_user_agents');
  	$banned_exclude_ips = get_option('banned_exclude_ips');
+ 	$banned_bad_urls = get_option('banned_bad_urls');
  	$is_excluded = false;
  	if(!empty($banned_exclude_ips)) {
  		foreach($banned_exclude_ips as $banned_exclude_ip) {
***************
*** 143,148 ****
--- 160,166 ----
  		process_ban($banned_hosts, @gethostbyaddr($ip));
  		process_ban($banned_referers, $_SERVER['HTTP_REFERER']);
  		process_ban($banned_user_agents, $_SERVER['HTTP_USER_AGENT']);
+ 		process_ban_bad_url($banned_bad_urls, $_SERVER['REQUEST_URI']);
  	}
  }
  
***************
*** 224,229 ****
--- 242,248 ----
  	$banned_hosts = array();
  	$banned_referers = array();
  	$banned_exclude_ips = array();
+ 	$banned_bad_urls = array();
  	$banned_stats = array('users' => array(), 'count' => 0);
  	add_option('banned_ips', $banned_ips, 'Banned IPs');
  	add_option('banned_hosts', $banned_hosts, 'Banned Hosts');
***************
*** 244,248 ****
  	add_option('banned_ips_range', $banned_ips_range, 'Banned IP Range');
  	// Database Upgrade For WP-Ban 1.30
  	add_option('banned_user_agents', $banned_user_agents, 'Banned User Agents');
  }
! ?>
\ No newline at end of file
--- 263,269 ----
  	add_option('banned_ips_range', $banned_ips_range, 'Banned IP Range');
  	// Database Upgrade For WP-Ban 1.30
  	add_option('banned_user_agents', $banned_user_agents, 'Banned User Agents');
+ 	// http://www.microshell.com/website_internet/security/updating-wp-ban-to-include-bad-urls
+ 	add_option('banned_bad_urls', $banned_bad_urls, 'Banned Bad URLs');
  }
! ?>
