Better handling of an empty spamStopWords entry in the config file, for WikiPage and Post.
This commit is contained in:
parent
d17d096380
commit
ffe4b8fa2c
3 changed files with 4 additions and 4 deletions
|
|
@ -1159,7 +1159,7 @@ sub postProcess {
|
|||
my %data = ();
|
||||
($data{synopsis}, $data{content}) = $self->getSynopsisAndContent($self->get("synopsis"), $self->get("content"));
|
||||
my $spamStopWords = $self->session->config->get('spamStopWords');
|
||||
if (ref $spamStopWords eq 'ARRAY') {
|
||||
if (ref $spamStopWords eq 'ARRAY' && @{ $spamStopWords }) {
|
||||
my $spamRegex = join('|',@{$spamStopWords});
|
||||
$spamRegex =~ s/\s/\\ /g;
|
||||
if ($data{content} =~ m/$spamRegex/xmsi) {
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ sub getAutoCommitWorkflowId {
|
|||
|
||||
# delete spam
|
||||
my $spamStopWords = $self->session->config->get('spamStopWords');
|
||||
if (ref $spamStopWords eq 'ARRAY') {
|
||||
if (ref $spamStopWords eq 'ARRAY' && @{ $spamStopWords }) {
|
||||
my $spamRegex = join('|',@{$spamStopWords});
|
||||
$spamRegex =~ s/\s/\\ /g;
|
||||
if ($self->get('content') =~ m{$spamRegex}xmsi) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue