diff --git a/showmore/showmore.php b/showmore/showmore.php index 89cec83d..e39acdee 100644 --- a/showmore/showmore.php +++ b/showmore/showmore.php @@ -107,26 +107,32 @@ function get_body_length($body) { return strlen($string); } -function showmore_prepare_body(&$a,&$b) { - - $words = null; - if(PConfig::get(local_user(),'showmore','disable')) +function showmore_prepare_body(\Friendica\App $a, &$hook_data) +{ + // No combination with content filters + if (!empty($hook_data['filter_reasons'])) { return; - - $chars = (int)PConfig::get(local_user(),'showmore','chars'); - if(!$chars) - $chars = 1100; - - if (get_body_length($b['html']) > $chars) { - $found = true; - $shortened = trim(showmore_cutitem($b['html'], $chars))."..."; } - if($found) { + if (PConfig::get(local_user(), 'showmore', 'disable')) { + return; + } + + $chars = (int) PConfig::get(local_user(), 'showmore', 'chars'); + if (!$chars) { + $chars = 1100; + } + + if (get_body_length($hook_data['html']) > $chars) { + $found = true; + $shortened = trim(showmore_cutitem($hook_data['html'], $chars)) . "..."; + } + + if ($found) { $rnd = random_string(8); - $b['html'] = '
'; + $hook_data['html'] = ' '. - ' ' . + ' '; } }