From 595ffeb396fa860d43c3a39794e8f896eb351983 Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Tue, 30 Oct 2007 08:47:59 +0000 Subject: [PATCH] (NewMultiUrlBannedContent): Make the limit configurable. --- modules/multi-url-spam-block.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/multi-url-spam-block.pl b/modules/multi-url-spam-block.pl index 66369dda..7f346854 100644 --- a/modules/multi-url-spam-block.pl +++ b/modules/multi-url-spam-block.pl @@ -13,13 +13,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -$ModulesDescription .= '

$Id: multi-url-spam-block.pl,v 1.2 2007/10/27 19:33:43 as Exp $

'; +$ModulesDescription .= '

$Id: multi-url-spam-block.pl,v 1.3 2007/10/30 08:47:59 as Exp $

'; *OldMultiUrlBannedContent = *BannedContent; *BannedContent = *NewMultiUrlBannedContent; $BannedContent = $OldMultiUrlBannedContent; # copy scalar +$MultiUrlLimit = 30; + sub NewMultiUrlBannedContent { my $str = shift; my @urls = $str =~ /$FullUrlPattern/go; @@ -34,7 +36,7 @@ sub NewMultiUrlBannedContent { $domains{$domain}++; $max = $domains{$domain} if $domains{$domain} > $max; } - return T('You linked more than 30 times to the same domain. It would seem that only a spammer would do this. Your edit is refused.') - if $max > 30; + return Ts('You linked more than %s times to the same domain. It would seem that only a spammer would do this. Your edit is refused.', $MultiUrlLimit) + if $max > $MultiUrlLimit; return OldMultiUrlBannedContent($str); }