forked from friendica/friendica-addons
[langfilter] Use new Text\BBCode::toPlaintext to calculate minimum body size
This commit is contained in:
parent
776aae9147
commit
eafe9d68b0
|
@ -134,12 +134,15 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$naked_body = Text\BBCode::toPlaintext($hook_data['item']['body'], false);
|
||||||
|
|
||||||
// Don't filter if body lenght is below minimum
|
// 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) {
|
if (!$minlen) {
|
||||||
$minlen = 32;
|
$minlen = 32;
|
||||||
}
|
}
|
||||||
if (strlen($hook_data['item']['body']) < $minlen) {
|
|
||||||
|
if (strlen($naked_body) < $minlen) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue