From: Hypolite Petovan Date: Sat, 21 Apr 2018 08:13:53 +0000 (-0400) Subject: [langfilter] Use new Text\BBCode::toPlaintext to calculate minimum body size X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=eafe9d68b09b9f8fe6339f5be925f4797f18b26f;p=friendica-addons.git [langfilter] Use new Text\BBCode::toPlaintext to calculate minimum body size --- diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index f6a6ce21..38b2e117 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -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; }