From eafe9d68b09b9f8fe6339f5be925f4797f18b26f Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 21 Apr 2018 04:13:53 -0400 Subject: [PATCH] [langfilter] Use new Text\BBCode::toPlaintext to calculate minimum body size --- langfilter/langfilter.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index f6a6ce210..38b2e117b 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; }