Commit f79b46ba authored by theo lem's avatar theo lem
Browse files

quick fix : function form_contains_suspicious_words wasn't called

parent e644b775
......@@ -98,9 +98,7 @@ function framaforms_spam_node_presave($node) {
}
// Detect words that should be considered as suspicious
// TODO : make this configurable through admin interface
$suspicious_words = "%(free|watch|online|movie|pelicula|completa|streaming|1080|fortnite|tiktok|mulan|poker)%";
if($node->type == 'form1' && $node->nid != NULL && preg_match($suspicious_words, strtolower($node->title)) != 0){
if($node->type == 'form1' && $node->nid != NULL && framaforms_spam_form_contains_forbidden_word($node->title)){
framaforms_spam_put_node_into_quarantine($node);
drupal_set_message(t("Your form contains suspicious words and is therefore considered as spam. The site's administrators will review it shortly."), 'warning');
return;
......
......@@ -371,7 +371,7 @@ function framaforms_spam_return_suspicious_view_definition(){
$handler->display->display_options['filters']['title']['table'] = 'node';
$handler->display->display_options['filters']['title']['field'] = 'title';
$handler->display->display_options['filters']['title']['operator'] = 'word';
$handler->display->display_options['filters']['title']['value'] = 'watch, online, free, movie, pelicula, completa, livestream, live, streaming, stream, HD, 1080p, fortnite, tiktok,';
$handler->display->display_options['filters']['title']['value'] = variable_get('framaforms_spam_forbidden_words');
/* Critère de filtrage: Contenu : uid de l'auteur */
$handler->display->display_options['filters']['uid']['id'] = 'uid';
$handler->display->display_options['filters']['uid']['table'] = 'node';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment