From: Michael Vogel Date: Sat, 17 Jul 2021 23:36:23 +0000 (+0200) Subject: Langfilter: Improve performance by using pre rendered content X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=dc81a5cf5f6f081d92dd7e56df7fd4c4033b86e4;p=friendica-addons.git Langfilter: Improve performance by using pre rendered content --- diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index 456a2d1c..0cf3e552 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -117,7 +117,11 @@ function langfilter_prepare_body_content_filter(App $a, &$hook_data) return; } - $naked_body = BBCode::toPlaintext($hook_data['item']['body'], false); + if (!empty($hook_data['item']['rendered-html'])) { + $naked_body = strip_tags($hook_data['item']['rendered-html']); + } else { + $naked_body = BBCode::toPlaintext($hook_data['item']['body'], false); + } // Don't filter if body lenght is below minimum $minlen = DI::pConfig()->get(local_user(), 'langfilter', 'minlength', 32);