Hi,
There is already a rate-limit feature in the premium version of NinjaFirewall.
But if you just want to block search queries containing several question marks, you can use the .htninja file:
<?php
/*
+===================================================================+
| NinjaFirewall optional configuration file |
| |
| See: http://nintechnet.com/ninjafirewall/wp-edition/help/?htninja |
+===================================================================+
*/
// Block search requests containing at least 4 consecutive "?" signs:
if ( isset( $_GET['s'] ) && strpos( $_GET['s'], '????' ) !== FALSE ) {
return 'BLOCK'; // reject it
}
-
This reply was modified 8 years, 11 months ago by
nintechnet.
-
This reply was modified 8 years, 11 months ago by
nintechnet.
Hi nintechnet,
thanks – that works perfect.
How do i extend this to do the same with all asia letters? My blog is english and i dont want the stats to be messed up with this words.
Like this:
美爪屋
心机少女
开封奇谈-这个包公不太行
…and also russia and turkish letters…
по волчьим законам
sevimli küçük yalancilar
Use regular expression to check the unicode character, for instance, Han for Chinese:
if ( isset( $_GET['s'] ) && preg_match( '/\p{Han}/u', $_GET['s']) ) {
return 'BLOCK'; // reject it
}
Cyrillic should do for Russian. See http://php.net/manual/en/regexp.reference.unicode.php