]> git.mxchange.org Git - friendica-addons.git/commitdiff
[langfilter] Use new Text\BBCode::toPlaintext to calculate minimum body size
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 21 Apr 2018 08:13:53 +0000 (04:13 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Sat, 21 Apr 2018 08:28:03 +0000 (04:28 -0400)
langfilter/langfilter.php

index f6a6ce210500757695b043e127641d11e14234ef..38b2e117be23d53f92ed9373056965246c667ca6 100644 (file)
@@ -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;
        }