[langfilter] Use new Text\BBCode::toPlaintext to calculate minimum body size

This commit is contained in:
Hypolite Petovan 2018-04-21 04:13:53 -04:00
parent 776aae9147
commit eafe9d68b0

View file

@ -134,12 +134,15 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data)
return;
}
$naked_body = Text\BBCode::toPlaintext($hook_data['item']['body'], false);
// Don't filter if body lenght is below minimum
$minlen = PConfig::get(local_user(), 'langfilter', 'minlength');
$minlen = PConfig::get(local_user(), 'langfilter', 'minlength', 32);
if (!$minlen) {
$minlen = 32;
}
if (strlen($hook_data['item']['body']) < $minlen) {
if (strlen($naked_body) < $minlen) {
return;
}