]> git.mxchange.org Git - friendica-addons.git/commitdiff
Langfilter: Improve performance by using pre rendered content
authorMichael Vogel <icarus@dabo.de>
Sat, 17 Jul 2021 23:36:23 +0000 (01:36 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 17 Jul 2021 23:36:23 +0000 (01:36 +0200)
langfilter/langfilter.php

index 456a2d1ca5888c09d35186c2de66692f9293367d..0cf3e552cb7dfea4be7b1c1c12723159d83ec1fc 100644 (file)
@@ -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);