3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-04 18:38:47 +02:00

Limit factoid keywords to 30 characters

This commit is contained in:
Pragmatic Software 2017-11-13 12:00:34 -08:00
parent f71dcfcf0e
commit d644ac04d5
2 changed files with 8 additions and 0 deletions

View File

@ -1131,6 +1131,8 @@ sub factfind {
$arguments =~ s/\s+$//;
$arguments =~ s/\s+/ /g;
$arguments = substr($arguments, 0, 30);
my $argtype = undef;
if($owner ne '.*') {

View File

@ -207,6 +207,12 @@ sub interpret {
$keyword = $command;
}
if (length $keyword > 30) {
$keyword = substr($keyword, 0, 30);
$self->{pbot}->{logger}->log("Truncating keyword to 30 chars: $keyword\n");
}
$tonick = $nick if defined $tonick and $tonick eq 'me';
if ($keyword !~ /^(?:factrem|forget|set|factdel|factadd|add|factfind|find|factshow|show|forget|factdel|factset|factchange|change|msg|tell|cc|eval|u|udict|ud|actiontrigger|urban|perl)$/) {