https://reisub.nsupdate.info/git
/
friendica-addons.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
776aae9
)
[langfilter] Use new Text\BBCode::toPlaintext to calculate minimum body size
author
Hypolite Petovan
<mrpetovan@gmail.com>
Sat, 21 Apr 2018 08:13:53 +0000
(
04:13
-0400)
committer
Hypolite Petovan
<mrpetovan@gmail.com>
Sat, 21 Apr 2018 08:28:03 +0000
(
04:28
-0400)
langfilter/langfilter.php
patch
|
blob
|
history
diff --git
a/langfilter/langfilter.php
b/langfilter/langfilter.php
index
f6a6ce2
..
38b2e11
100644
(file)
--- 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;
}